From 4751ddabfe3a28f1cd7c940a3e5e8ea45461b4d9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 2 Sep 2024 02:24:28 +0000 Subject: [PATCH] CodeGen from PR 3486 in test-repo-billy/azure-rest-api-specs Merge d89b28f77b3a51daf78eec3de0629005f3ed8329 into 2b91022c223ed3618c268c750f831b76fe0f4fb5 --- .../tsp-location.yaml | 7 +- .../tsp-location.yaml | 6 +- .../tsp-location.yaml | 7 +- .../Sample_AgentPoolSnapshotResource.cs | 148 - .../Sample_AgentPoolUpgradeProfileResource.cs | 49 - ...ple_ContainerServiceAgentPoolCollection.cs | 1067 ------ ...ample_ContainerServiceAgentPoolResource.cs | 983 ------ ...rviceMaintenanceConfigurationCollection.cs | 419 --- ...ServiceMaintenanceConfigurationResource.cs | 241 -- ...ontainerServiceManagedClusterCollection.cs | 2858 ---------------- ..._ContainerServiceManagedClusterResource.cs | 665 ---- ...vicePrivateEndpointConnectionCollection.cs | 207 -- ...ervicePrivateEndpointConnectionResource.cs | 118 - ...rviceTrustedAccessRoleBindingCollection.cs | 203 -- ...ServiceTrustedAccessRoleBindingResource.cs | 114 - ...ollection.cs => Sample_FleetCollection.cs} | 118 +- .../Samples/Sample_FleetMemberCollection.cs | 203 ++ .../Samples/Sample_FleetMemberResource.cs | 115 + .../Generated/Samples/Sample_FleetResource.cs | 177 + .../Sample_FleetUpdateStrategyCollection.cs | 214 ++ .../Sample_FleetUpdateStrategyResource.cs | 125 + ...le_ManagedClusterUpgradeProfileResource.cs | 48 - .../Sample_MeshRevisionProfileCollection.cs | 160 - .../Sample_MeshRevisionProfileResource.cs | 48 - .../Sample_MeshUpgradeProfileCollection.cs | 163 - .../Sample_MeshUpgradeProfileResource.cs | 49 - .../Samples/Sample_OSOptionProfileResource.cs | 47 - .../Sample_SubscriptionResourceExtensions.cs | 74 - .../Samples/Sample_UpdateRunCollection.cs | 222 ++ .../Samples/Sample_UpdateRunResource.cs | 236 ++ .../Generated/AgentPoolSnapshotCollection.cs | 498 --- .../src/Generated/AgentPoolSnapshotData.cs | 123 - ...AgentPoolSnapshotResource.Serialization.cs | 26 - ...entPoolUpgradeProfileData.Serialization.cs | 237 -- .../Generated/AgentPoolUpgradeProfileData.cs | 100 - ...oolUpgradeProfileResource.Serialization.cs | 26 - .../AgentPoolUpgradeProfileResource.cs | 171 - .../ArmContainerServiceModelFactory.cs | 1001 +----- .../ContainerServiceAgentPoolCollection.cs | 493 --- ...ainerServiceAgentPoolData.Serialization.cs | 891 ----- .../ContainerServiceAgentPoolData.cs | 271 -- ...rServiceAgentPoolResource.Serialization.cs | 26 - ...rviceMaintenanceConfigurationCollection.cs | 497 --- ...inerServiceMaintenanceConfigurationData.cs | 85 - ...anceConfigurationResource.Serialization.cs | 26 - ...ServiceMaintenanceConfigurationResource.cs | 355 -- ...ontainerServiceManagedClusterCollection.cs | 494 --- ...ServiceManagedClusterData.Serialization.cs | 896 ----- .../ContainerServiceManagedClusterData.cs | 282 -- ...iceManagedClusterResource.Serialization.cs | 26 - .../ContainerServiceManagedClusterResource.cs | 2330 ------------- ...vicePrivateEndpointConnectionCollection.cs | 495 --- ...nerServicePrivateEndpointConnectionData.cs | 96 - ...ndpointConnectionResource.Serialization.cs | 26 - ...rviceTrustedAccessRoleBindingCollection.cs | 493 --- ...inerServiceTrustedAccessRoleBindingData.cs | 97 - ...AccessRoleBindingResource.Serialization.cs | 26 - .../Extensions/ContainerServiceExtensions.cs | 663 +--- .../MockableContainerServiceArmClient.cs | 132 +- ...leContainerServiceResourceGroupResource.cs | 117 +- ...bleContainerServiceSubscriptionResource.cs | 319 +- .../src/Generated/FleetCollection.cs | 498 +++ ...lization.cs => FleetData.Serialization.cs} | 182 +- .../src/Generated/FleetData.cs | 95 + .../src/Generated/FleetMemberCollection.cs | 497 +++ ...on.cs => FleetMemberData.Serialization.cs} | 100 +- .../src/Generated/FleetMemberData.cs | 87 + .../FleetMemberResource.Serialization.cs | 26 + ...tionResource.cs => FleetMemberResource.cs} | 177 +- .../Generated/FleetResource.Serialization.cs | 26 + ...eAgentPoolResource.cs => FleetResource.cs} | 591 ++-- .../FleetUpdateStrategyCollection.cs | 497 +++ ... FleetUpdateStrategyData.Serialization.cs} | 89 +- .../src/Generated/FleetUpdateStrategyData.cs | 89 + ...eetUpdateStrategyResource.Serialization.cs | 26 + ...urce.cs => FleetUpdateStrategyResource.cs} | 166 +- ...ontainerServiceAgentPoolOperationSource.cs | 38 - ...nerServiceManagedClusterOperationSource.cs | 38 - ...TrustedAccessRoleBindingOperationSource.cs | 38 - .../FleetMemberOperationSource.cs | 38 + .../FleetOperationSource.cs | 38 + .../FleetUpdateStrategyOperationSource.cs | 38 + ...dClusterRunCommandResultOperationSource.cs | 30 - .../UpdateRunOperationSource.cs | 38 + ...ClusterUpgradeProfileData.Serialization.cs | 209 -- .../ManagedClusterUpgradeProfileData.cs | 93 - ...terUpgradeProfileResource.Serialization.cs | 26 - .../ManagedClusterUpgradeProfileResource.cs | 170 - .../MeshRevisionProfileCollection.cs | 399 --- .../src/Generated/MeshRevisionProfileData.cs | 85 - ...shRevisionProfileResource.Serialization.cs | 26 - .../Generated/MeshRevisionProfileResource.cs | 171 - .../Generated/MeshUpgradeProfileCollection.cs | 395 --- .../src/Generated/MeshUpgradeProfileData.cs | 75 - ...eshUpgradeProfileResource.Serialization.cs | 26 - .../Generated/MeshUpgradeProfileResource.cs | 171 - ...AgentPoolAvailableVersion.Serialization.cs | 152 - .../Models/AgentPoolAvailableVersion.cs | 73 - ...gentPoolAvailableVersions.Serialization.cs | 206 -- .../Models/AgentPoolAvailableVersions.cs | 72 - .../src/Generated/Models/AgentPoolMode.cs | 51 - .../Models/AgentPoolNetworkPortProtocol.cs | 51 - ...AgentPoolNetworkPortRange.Serialization.cs | 156 - .../Models/AgentPoolNetworkPortRange.cs | 73 - .../AgentPoolNetworkProfile.Serialization.cs | 198 -- .../Models/AgentPoolNetworkProfile.cs | 77 - ...entPoolSnapshotListResult.Serialization.cs | 147 - .../src/Generated/Models/AgentPoolType.cs | 51 - ...ilePropertiesUpgradesItem.Serialization.cs | 137 - .../Models/AgentPoolUpgradeSettings.cs | 69 - ...ation.cs => AgentProfile.Serialization.cs} | 68 +- ...lSnapshotListResult.cs => AgentProfile.cs} | 30 +- ...> ApiServerAccessProfile.Serialization.cs} | 50 +- ...roperties.cs => ApiServerAccessProfile.cs} | 21 +- .../src/Generated/Models/AutoScaleExpander.cs | 57 - ...erviceAgentPoolListResult.Serialization.cs | 147 - .../ContainerServiceAgentPoolListResult.cs | 70 - .../ContainerServiceDateSpan.Serialization.cs | 127 - .../Models/ContainerServiceDateSpan.cs | 78 - ...ServiceEndpointDependency.Serialization.cs | 147 - ...inerServiceEndpointDetail.Serialization.cs | 164 - .../Models/ContainerServiceEndpointDetail.cs | 78 - ...tainerServiceLinuxProfile.Serialization.cs | 127 - .../Models/ContainerServiceLinuxProfile.cs | 88 - .../Models/ContainerServiceLoadBalancerSku.cs | 51 - ...ceAbsoluteMonthlySchedule.Serialization.cs | 127 - ...ceConfigurationListResult.Serialization.cs | 147 - ...ceRelativeMonthlySchedule.Serialization.cs | 135 - ...rviceMaintenanceRelativeMonthlySchedule.cs | 84 - ...tenanceRelativeMonthlyScheduleWeekIndex.cs | 60 - ...erviceMaintenanceSchedule.Serialization.cs | 171 - .../ContainerServiceMaintenanceSchedule.cs | 87 - ...MaintenanceWeeklySchedule.Serialization.cs | 127 - ...ntainerServiceMaintenanceWeeklySchedule.cs | 78 - ...rServiceMaintenanceWindow.Serialization.cs | 189 -- .../ContainerServiceMaintenanceWindow.cs | 101 - .../Models/ContainerServiceNetworkMode.cs | 51 - .../Models/ContainerServiceNetworkPlugin.cs | 54 - .../ContainerServiceNetworkPluginMode.cs | 48 - .../Models/ContainerServiceNetworkPolicy.cs | 54 - ...inerServiceNetworkProfile.Serialization.cs | 370 --- .../Models/ContainerServiceNetworkProfile.cs | 124 - .../Models/ContainerServiceOSDiskType.cs | 51 - ...erServiceOSOptionProperty.Serialization.cs | 127 - .../Generated/Models/ContainerServiceOSSku.cs | 60 - .../Models/ContainerServiceOSType.cs | 51 - ...tboundEnvironmentEndpoint.Serialization.cs | 147 - ...ainerServiceOutboundEnvironmentEndpoint.cs | 70 - .../Models/ContainerServiceOutboundType.cs | 57 - ...pointConnectionListResult.Serialization.cs | 136 - ...vicePrivateEndpointConnectionListResult.cs | 66 - ...vateEndpointConnectionProvisioningState.cs | 60 - ...cePrivateLinkResourceData.Serialization.cs | 210 -- ...ContainerServicePrivateLinkResourceData.cs | 87 - ...teLinkResourcesListResult.Serialization.cs | 136 - ...erServicePrivateLinkResourcesListResult.cs | 66 - ...inkServiceConnectionState.Serialization.cs | 137 - ...rvicePrivateLinkServiceConnectionStatus.cs | 57 - .../ContainerServicePublicNetworkAccess.cs | 51 - .../Models/ContainerServiceStateCode.cs | 51 - .../Models/ContainerServiceTimeInWeek.cs | 70 - .../ContainerServiceTrustedAccessRole.cs | 74 - ...ustedAccessRoleBindingProvisioningState.cs | 60 - ...viceTrustedAccessRoleRule.Serialization.cs | 242 -- .../ContainerServiceTrustedAccessRoleRule.cs | 86 - ...rviceUserAssignedIdentity.Serialization.cs | 156 - .../ContainerServiceUserAssignedIdentity.cs | 74 - .../Models/ContainerServiceWeekDay.cs | 66 - ...=> FleetCredentialResult.Serialization.cs} | 38 +- ...Credential.cs => FleetCredentialResult.cs} | 12 +- ...> FleetCredentialResults.Serialization.cs} | 56 +- ...edentials.cs => FleetCredentialResults.cs} | 20 +- .../Models/FleetHubProfile.Serialization.cs | 192 ++ .../src/Generated/Models/FleetHubProfile.cs | 97 + ...on.cs => FleetListResult.Serialization.cs} | 73 +- ...gradeProfileList.cs => FleetListResult.cs} | 36 +- ...=> FleetMemberListResult.Serialization.cs} | 73 +- ...hPublicKey.cs => FleetMemberListResult.cs} | 37 +- ...n.cs => FleetMemberPatch.Serialization.cs} | 61 +- ...UpgradeSettings.cs => FleetMemberPatch.cs} | 20 +- .../Models/FleetMemberProvisioningState.cs | 63 + ...ization.cs => FleetPatch.Serialization.cs} | 54 +- ...inerServiceTagsObject.cs => FleetPatch.cs} | 17 +- .../Models/FleetProvisioningState.cs | 63 + ...UpdateStrategyListResult.Serialization.cs} | 78 +- ...on.cs => FleetUpdateStrategyListResult.cs} | 36 +- .../FleetUpdateStrategyProvisioningState.cs | 54 + .../Generated/Models/GpuInstanceProfile.cs | 60 - .../src/Generated/Models/IPFamily.cs | 51 - .../Models/IstioCertificateAuthority.cs | 65 - .../src/Generated/Models/IstioComponents.cs | 71 - .../Generated/Models/IstioEgressGateway.cs | 77 - .../Generated/Models/IstioIngressGateway.cs | 78 - .../Models/IstioIngressGatewayMode.cs | 51 - ...luginCertificateAuthority.Serialization.cs | 176 - .../Models/IstioPluginCertificateAuthority.cs | 82 - .../src/Generated/Models/IstioServiceMesh.cs | 86 - .../src/Generated/Models/KubeConfigFormat.cs | 51 - .../Models/KubeletConfig.Serialization.cs | 286 -- .../src/Generated/Models/KubeletConfig.cs | 106 - .../src/Generated/Models/KubeletDiskType.cs | 51 - .../Generated/Models/KubernetesSupportPlan.cs | 51 - .../src/Generated/Models/KubernetesVersion.cs | 84 - .../Models/KubernetesVersionCapabilities.cs | 66 - ...bernetesVersionListResult.Serialization.cs | 136 - .../Models/LinuxOSConfig.Serialization.cs | 163 - .../src/Generated/Models/LinuxOSConfig.cs | 77 - .../ManagedClusterAadProfile.Serialization.cs | 230 -- .../Models/ManagedClusterAadProfile.cs | 90 - ...anagedClusterAddonProfile.Serialization.cs | 160 - .../Models/ManagedClusterAddonProfile.cs | 81 - ...usterAddonProfileIdentity.Serialization.cs | 156 - .../ManagedClusterAddonProfileIdentity.cs | 31 - ...edClusterAgentPoolProfile.Serialization.cs | 831 ----- .../Models/ManagedClusterAgentPoolProfile.cs | 86 - ...gentPoolProfileProperties.Serialization.cs | 822 ----- ...anagedClusterAgentPoolProfileProperties.cs | 262 -- ...terApiServerAccessProfile.Serialization.cs | 198 -- .../ManagedClusterApiServerAccessProfile.cs | 82 - ...dClusterAutoScalerProfile.Serialization.cs | 320 -- .../Models/ManagedClusterAutoScalerProfile.cs | 129 - ...ClusterAutoUpgradeProfile.Serialization.cs | 141 - .../ManagedClusterAutoUpgradeProfile.cs | 69 - ...lusterAzureMonitorProfile.Serialization.cs | 126 - .../ManagedClusterAzureMonitorProfile.cs | 65 - ...ManagedClusterCredentials.Serialization.cs | 136 - .../Models/ManagedClusterDelegatedIdentity.cs | 78 - ...gedClusterHttpProxyConfig.Serialization.cs | 169 - .../Models/ManagedClusterHttpProxyConfig.cs | 78 - ...ManagedClusterKeyVaultNetworkAccessType.cs | 51 - .../Models/ManagedClusterListResult.cs | 70 - ...nagedClusterLoadBalancerBackendPoolType.cs | 51 - ...lusterLoadBalancerProfile.Serialization.cs | 251 -- .../ManagedClusterLoadBalancerProfile.cs | 117 - ...ProfileManagedOutboundIPs.Serialization.cs | 141 - ...erLoadBalancerProfileManagedOutboundIPs.cs | 69 - ...ProfileOutboundIPPrefixes.Serialization.cs | 137 - ...erLoadBalancerProfileOutboundIPPrefixes.cs | 67 - ...alancerProfileOutboundIPs.Serialization.cs | 137 - ...edClusterLoadBalancerProfileOutboundIPs.cs | 67 - ...rManagedOutboundIPProfile.Serialization.cs | 126 - ...orProfileKubeStateMetrics.Serialization.cs | 133 - ...edClusterMonitorProfileKubeStateMetrics.cs | 69 - ...sterMonitorProfileMetrics.Serialization.cs | 134 - .../ManagedClusterMonitorProfileMetrics.cs | 76 - ...dClusterNatGatewayProfile.Serialization.cs | 167 - .../Models/ManagedClusterNatGatewayProfile.cs | 87 - .../ManagedClusterNodeOSUpgradeChannel.cs | 54 - ...dClusterOidcIssuerProfile.Serialization.cs | 137 - .../Models/ManagedClusterOidcIssuerProfile.cs | 69 - ...ManagedClusterPodIdentity.Serialization.cs | 183 - .../Models/ManagedClusterPodIdentity.cs | 106 - ...usterPodIdentityException.Serialization.cs | 146 - .../ManagedClusterPodIdentityException.cs | 89 - ...ClusterPodIdentityProfile.Serialization.cs | 191 -- .../ManagedClusterPodIdentityProfile.cs | 79 - ...IdentityProvisioningError.Serialization.cs | 126 - ...agedClusterPodIdentityProvisioningError.cs | 65 - ...dIdentityProvisioningInfo.Serialization.cs | 126 - ...agedClusterPodIdentityProvisioningState.cs | 63 - ...ClusterPoolUpgradeProfile.Serialization.cs | 163 - .../ManagedClusterPoolUpgradeProfile.cs | 90 - ...pgradeProfileUpgradesItem.Serialization.cs | 137 - ...dClusterRunCommandContent.Serialization.cs | 141 - ...edClusterRunCommandResult.Serialization.cs | 223 -- .../Models/ManagedClusterRunCommandResult.cs | 89 - ...gedClusterSecurityProfile.Serialization.cs | 171 - .../Models/ManagedClusterSecurityProfile.cs | 89 - ...erSecurityProfileDefender.Serialization.cs | 141 - .../ManagedClusterSecurityProfileDefender.cs | 81 - ...efenderSecurityMonitoring.Serialization.cs | 126 - ...curityProfileDefenderSecurityMonitoring.cs | 65 - ...curityProfileImageCleaner.Serialization.cs | 141 - ...nagedClusterSecurityProfileImageCleaner.cs | 69 - ...ecurityProfileKeyVaultKms.Serialization.cs | 167 - ...anagedClusterSecurityProfileKeyVaultKms.cs | 78 - ...tyProfileWorkloadIdentity.Serialization.cs | 126 - ...dClusterSecurityProfileWorkloadIdentity.cs | 65 - ...erServicePrincipalProfile.Serialization.cs | 130 - .../Generated/Models/ManagedClusterSkuName.cs | 48 - .../Generated/Models/ManagedClusterSkuTier.cs | 54 - ...agedClusterStorageProfile.Serialization.cs | 171 - .../Models/ManagedClusterStorageProfile.cs | 80 - ...nagedClusterStorageProfileBlobCsiDriver.cs | 65 - ...orageProfileDiskCsiDriver.Serialization.cs | 126 - ...nagedClusterStorageProfileDiskCsiDriver.cs | 65 - ...orageProfileFileCsiDriver.Serialization.cs | 126 - ...nagedClusterStorageProfileFileCsiDriver.cs | 65 - ...ProfileSnapshotController.Serialization.cs | 126 - ... => ManagedClusterUpdate.Serialization.cs} | 58 +- ...mandContent.cs => ManagedClusterUpdate.cs} | 53 +- ...anagedClusterUpgradeSpec.Serialization.cs} | 62 +- ...esItem.cs => ManagedClusterUpgradeSpec.cs} | 33 +- .../Models/ManagedClusterUpgradeType.cs | 54 + ...sterVerticalPodAutoscaler.Serialization.cs | 119 - .../ManagedClusterVerticalPodAutoscaler.cs | 72 - ...agedClusterWindowsProfile.Serialization.cs | 181 - .../Models/ManagedClusterWindowsProfile.cs | 91 - ...WorkloadAutoScalerProfile.Serialization.cs | 141 - ...ManagedClusterWorkloadAutoScalerProfile.cs | 88 - ...gedClusterWorkloadAutoScalerProfileKeda.cs | 72 - ...> ManagedServiceIdentity.Serialization.cs} | 89 +- .../Models/ManagedServiceIdentity.cs | 86 + .../Models/ManagedServiceIdentityType.cs | 57 + .../MemberUpdateStatus.Serialization.cs} | 116 +- ...gedClusterSku.cs => MemberUpdateStatus.cs} | 39 +- .../src/Generated/Models/MeshRevision.cs | 75 - .../MeshRevisionProfileList.Serialization.cs | 147 - .../Models/MeshRevisionProfileList.cs | 70 - ...RevisionProfileProperties.Serialization.cs | 136 - ...hUpgradeProfileProperties.Serialization.cs | 172 - .../Models/MeshUpgradeProfileProperties.cs | 30 - .../src/Generated/Models/NetworkDataplane.cs | 51 - ...cs => NodeImageSelection.Serialization.cs} | 63 +- ...DailySchedule.cs => NodeImageSelection.cs} | 28 +- ...NodeImageSelectionStatus.Serialization.cs} | 71 +- ...tResult.cs => NodeImageSelectionStatus.cs} | 22 +- .../Models/NodeImageSelectionType.cs | 51 + ...n.cs => NodeImageVersion.Serialization.cs} | 51 +- ...rvicePowerState.cs => NodeImageVersion.cs} | 20 +- .../src/Generated/Models/ScaleDownMode.cs | 51 - .../Models/ScaleSetEvictionPolicy.cs | 51 - .../src/Generated/Models/ScaleSetPriority.cs | 51 - .../src/Generated/Models/ServiceMeshMode.cs | 51 - ...ion.cs => SkipProperties.Serialization.cs} | 57 +- ...erviceMeshProfile.cs => SkipProperties.cs} | 36 +- .../Models/SkipTarget.Serialization.cs | 127 + .../src/Generated/Models/SkipTarget.cs | 93 + .../src/Generated/Models/SnapshotType.cs | 48 - .../Models/SysctlConfig.Serialization.cs | 556 ---- .../src/Generated/Models/SysctlConfig.cs | 173 - .../src/Generated/Models/TargetType.cs | 57 + ...cessRoleBindingListResult.Serialization.cs | 147 - ...ustedAccessRoleListResult.Serialization.cs | 147 - .../Models/TrustedAccessRoleListResult.cs | 70 - ...zation.cs => UpdateGroup.Serialization.cs} | 48 +- .../{CompatibleVersions.cs => UpdateGroup.cs} | 40 +- ....cs => UpdateGroupStatus.Serialization.cs} | 70 +- ...onnectionState.cs => UpdateGroupStatus.cs} | 31 +- ...s => UpdateRunListResult.Serialization.cs} | 75 +- ...onListResult.cs => UpdateRunListResult.cs} | 36 +- .../Models/UpdateRunProvisioningState.cs | 54 + ...on.cs => UpdateRunStatus.Serialization.cs} | 91 +- ...eMonthlySchedule.cs => UpdateRunStatus.cs} | 43 +- ....cs => UpdateRunStrategy.Serialization.cs} | 72 +- ...OptionProperty.cs => UpdateRunStrategy.cs} | 47 +- ...zation.cs => UpdateStage.Serialization.cs} | 86 +- .../src/Generated/Models/UpdateStage.cs | 84 + ....cs => UpdateStageStatus.Serialization.cs} | 113 +- ...errideSettings.cs => UpdateStageStatus.cs} | 37 +- .../src/Generated/Models/UpdateState.cs | 66 + ...ation.cs => UpdateStatus.Serialization.cs} | 109 +- ...inerServiceTimeSpan.cs => UpdateStatus.cs} | 34 +- .../src/Generated/Models/UpgradeChannel.cs | 60 - ...ization.cs => WaitStatus.Serialization.cs} | 62 +- ...erServiceCreationData.cs => WaitStatus.cs} | 25 +- .../Generated/Models/WindowsGmsaProfile.cs | 73 - .../Generated/Models/WindowsVmLicenseType.cs | 51 - .../src/Generated/Models/WorkloadRuntime.cs | 51 - .../OSOptionProfileData.Serialization.cs | 200 -- .../src/Generated/OSOptionProfileData.cs | 86 - .../OSOptionProfileResource.Serialization.cs | 26 - .../src/Generated/OSOptionProfileResource.cs | 172 - .../FleetMembersRestOperations.cs | 639 ++++ ...=> FleetUpdateStrategiesRestOperations.cs} | 324 +- ...tOperations.cs => FleetsRestOperations.cs} | 604 ++-- ...MaintenanceConfigurationsRestOperations.cs | 523 --- .../ManagedClustersRestOperations.cs | 2957 ----------------- ...rivateEndpointConnectionsRestOperations.cs | 439 --- .../PrivateLinkResourcesRestOperations.cs | 133 - ...solvePrivateLinkServiceIdRestOperations.cs | 141 - .../UpdateRunsRestOperations.cs | 841 +++++ .../src/Generated/UpdateRunCollection.cs | 497 +++ ...tion.cs => UpdateRunData.Serialization.cs} | 140 +- .../src/Generated/UpdateRunData.cs | 136 + .../UpdateRunResource.Serialization.cs | 26 + .../src/Generated/UpdateRunResource.cs | 620 ++++ .../src/autorest.md | 2 +- .../Azure.ResourceManager.Contoso.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../Azure.ResourceManager.Contoso/README.md | 86 + .../src/Azure.ResourceManager.Contoso.csproj | 10 + .../src/Generated/ArmContosoModelFactory.cs | 83 + .../src/Generated/EmployeeCollection.cs | 494 +++ .../Generated/EmployeeData.Serialization.cs} | 88 +- .../src/Generated/EmployeeData.cs} | 30 +- .../EmployeeResource.Serialization.cs | 26 + .../src/Generated/EmployeeResource.cs} | 278 +- .../Generated/Extensions/ContosoExtensions.cs | 289 ++ .../Extensions/MockableContosoArmClient.cs | 49 + .../MockableContosoResourceGroupResource.cs | 105 + .../MockableContosoSubscriptionResource.cs | 102 + .../MockableContosoTenantResource.cs | 95 + .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 +++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../ContosoArmOperation.cs | 94 + .../ContosoArmOperationOfT.cs | 100 + .../EmployeeOperationSource.cs | 38 + .../src/Generated/Models/ActionType.cs | 48 + .../EmployeeListResult.Serialization.cs} | 81 +- .../Generated/Models/EmployeeListResult.cs | 80 + .../Models/EmployeePatch.Serialization.cs} | 75 +- .../src/Generated/Models/EmployeePatch.cs} | 27 +- .../EmployeeProperties.Serialization.cs | 167 + .../Generated/Models/EmployeeProperties.cs} | 39 +- ...EmployeeUpdateProperties.Serialization.cs} | 89 +- .../Models/EmployeeUpdateProperties.cs} | 30 +- .../Models/Operation.Serialization.cs} | 122 +- .../src/Generated/Models/Operation.cs | 81 + .../Models/OperationDisplay.Serialization.cs | 155 + .../src/Generated/Models/OperationDisplay.cs | 77 + .../OperationListResult.Serialization.cs} | 58 +- .../Generated/Models/OperationListResult.cs} | 32 +- .../src/Generated/Models/Origin.cs | 54 + .../src/Generated/Models/ProvisioningState.cs | 66 + .../src/Generated/ProviderConstants.cs | 16 + .../EmployeesRestOperations.cs} | 448 ++- .../OperationsRestOperations.cs} | 100 +- .../src/Properties/AssemblyInfo.cs | 11 + ...Azure.ResourceManager.Contoso.Tests.csproj | 12 + .../tsp-location.yaml | 4 + sdk/contoso/ci.yml | 35 + .../Azure.Template.Contoso.sln | 56 + .../Azure.Template.Contoso/CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../Azure.Template.Contoso/README.md | 107 + .../src/Azure.Template.Contoso.csproj | 19 + .../src/Generated/Docs/Widgets.xml | 509 +++ .../FakedSharedModel.Serialization.cs | 143 + .../src/Generated/FakedSharedModel.cs} | 38 +- .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 +++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../src/Generated/OperationState.cs | 60 + ...dgetSuiteWidgetSuiteError.Serialization.cs | 173 + ...rationStatusWidgetSuiteWidgetSuiteError.cs | 89 + .../TemplateContosoClientBuilderExtensions.cs | 35 + .../Generated/TemplateContosoModelFactory.cs | 38 + .../src/Generated/WidgetManagerClient.cs | 69 + .../Generated/WidgetManagerClientOptions.cs | 37 + .../Generated/WidgetSuite.Serialization.cs | 161 + .../src/Generated/WidgetSuite.cs | 83 + .../src/Generated/Widgets.cs | 667 ++++ .../src/Properties/AssemblyInfo.cs | 11 + .../tests/Azure.Template.Contoso.Tests.csproj | 20 + .../Generated/Samples/Samples_Widgets.cs | 577 ++++ .../Azure.Template.Contoso/tsp-location.yaml | 5 + sdk/contosowidgetmanager/ci.yml | 35 + .../Generated/DeploymentEnvironmentsClient.cs | 16 +- .../src/Generated/DevBoxesClient.cs | 52 +- .../src/Generated/DevCenterModelFactory.cs | 160 +- .../DevCenterEnvironmentType.Serialization.cs | 7 +- .../Models/DevCenterEnvironmentType.cs | 7 +- .../Models/EnvironmentDefinitionParameter.cs | 6 +- .../Samples_DeploymentEnvironmentsClient.cs | 16 +- .../Samples/Samples_DevBoxesClient.cs | 16 +- .../tsp-location.yaml | 6 +- .../Azure.Developer.Signing/tsp-location.yaml | 4 + .../tsp-location.yaml | 7 +- ...g.EventGrid.SystemEvents.netstandard2.0.cs | 558 ++-- ...atMessageDeletedEventData.Serialization.cs | 26 +- .../AcsChatMessageDeletedEventData.cs | 10 +- ...eDeletedInThreadEventData.Serialization.cs | 26 +- .../AcsChatMessageDeletedInThreadEventData.cs | 10 +- ...hatMessageEditedEventData.Serialization.cs | 26 +- .../AcsChatMessageEditedEventData.cs | 9 +- ...geEditedInThreadEventData.Serialization.cs | 26 +- .../AcsChatMessageEditedInThreadEventData.cs | 9 +- ...essageEventBaseProperties.Serialization.cs | 13 +- .../AcsChatMessageEventBaseProperties.cs | 8 +- ...entInThreadBaseProperties.Serialization.cs | 13 +- ...sChatMessageEventInThreadBaseProperties.cs | 8 +- ...tMessageReceivedEventData.Serialization.cs | 13 +- .../AcsChatMessageReceivedEventData.cs | 5 +- ...ReceivedInThreadEventData.Serialization.cs | 13 +- ...AcsChatMessageReceivedInThreadEventData.cs | 5 +- ...antAddedToThreadEventData.Serialization.cs | 13 +- ...csChatParticipantAddedToThreadEventData.cs | 8 +- ...ToThreadWithUserEventData.Serialization.cs | 26 +- ...rticipantAddedToThreadWithUserEventData.cs | 9 +- ...emovedFromThreadEventData.Serialization.cs | 13 +- ...atParticipantRemovedFromThreadEventData.cs | 8 +- ...omThreadWithUserEventData.Serialization.cs | 26 +- ...ipantRemovedFromThreadWithUserEventData.cs | 9 +- ...hatThreadCreatedEventData.Serialization.cs | 13 +- .../AcsChatThreadCreatedEventData.cs | 5 +- ...dCreatedWithUserEventData.Serialization.cs | 13 +- .../AcsChatThreadCreatedWithUserEventData.cs | 5 +- ...hatThreadDeletedEventData.Serialization.cs | 26 +- .../AcsChatThreadDeletedEventData.cs | 9 +- ...ThreadEventBaseProperties.Serialization.cs | 13 +- .../AcsChatThreadEventBaseProperties.cs | 9 +- ...entInThreadBaseProperties.Serialization.cs | 13 +- ...csChatThreadEventInThreadBaseProperties.cs | 13 +- ...ropertiesUpdatedEventData.Serialization.cs | 26 +- ...AcsChatThreadPropertiesUpdatedEventData.cs | 9 +- ...esUpdatedPerUserEventData.Serialization.cs | 26 +- ...ThreadPropertiesUpdatedPerUserEventData.cs | 9 +- ...dWithUserDeletedEventData.Serialization.cs | 26 +- .../AcsChatThreadWithUserDeletedEventData.cs | 9 +- ...ryReportReceivedEventData.Serialization.cs | 32 +- ...AcsEmailDeliveryReportReceivedEventData.cs | 12 +- ...ngReportReceivedEventData.Serialization.cs | 32 +- ...gagementTrackingReportReceivedEventData.cs | 17 +- ...eryStatusUpdatedEventData.Serialization.cs | 39 +- ...csMessageDeliveryStatusUpdatedEventData.cs | 14 +- .../AcsMessageEventData.Serialization.cs | 13 +- .../src/Generated/AcsMessageEventData.cs | 8 +- ...MessageInteractiveContent.Serialization.cs | 13 +- .../Generated/AcsMessageInteractiveContent.cs | 8 +- ...sMessageReceivedEventData.Serialization.cs | 13 +- .../Generated/AcsMessageReceivedEventData.cs | 5 +- ...ileStatusUpdatedEventData.Serialization.cs | 52 +- .../AcsRecordingFileStatusUpdatedEventData.cs | 20 +- ...outerJobReceivedEventData.Serialization.cs | 26 +- .../AcsRouterJobReceivedEventData.cs | 12 +- ...SchedulingFailedEventData.Serialization.cs | 13 +- .../AcsRouterJobSchedulingFailedEventData.cs | 8 +- ...ingForActivationEventData.Serialization.cs | 13 +- ...sRouterJobWaitingForActivationEventData.cs | 8 +- ...orkerOfferIssuedEventData.Serialization.cs | 26 +- .../AcsRouterWorkerOfferIssuedEventData.cs | 12 +- .../AcsRouterWorkerSelector.Serialization.cs | 39 +- .../src/Generated/AcsRouterWorkerSelector.cs | 16 +- ...DeliveryAttemptProperties.Serialization.cs | 13 +- .../AcsSmsDeliveryAttemptProperties.cs | 13 +- ...ryReportReceivedEventData.Serialization.cs | 13 +- .../AcsSmsDeliveryReportReceivedEventData.cs | 8 +- .../AcsSmsReceivedEventData.Serialization.cs | 13 +- .../src/Generated/AcsSmsReceivedEventData.cs | 13 +- .../AppEventTypeDetail.Serialization.cs | 13 +- .../src/Generated/AppEventTypeDetail.cs | 13 +- ...ervicePlanEventTypeDetail.Serialization.cs | 39 +- .../AppServicePlanEventTypeDetail.cs | 21 +- ...municationIdentifierModel.Serialization.cs | 13 +- .../Generated/CommunicationIdentifierModel.cs | 8 +- ...RegistryArtifactEventData.Serialization.cs | 13 +- .../ContainerRegistryArtifactEventData.cs | 8 +- ...stryChartDeletedEventData.Serialization.cs | 13 +- .../ContainerRegistryChartDeletedEventData.cs | 5 +- ...istryChartPushedEventData.Serialization.cs | 13 +- .../ContainerRegistryChartPushedEventData.cs | 5 +- ...ontainerRegistryEventData.Serialization.cs | 13 +- .../Generated/ContainerRegistryEventData.cs | 8 +- ...stryImageDeletedEventData.Serialization.cs | 13 +- .../ContainerRegistryImageDeletedEventData.cs | 5 +- ...istryImagePushedEventData.Serialization.cs | 13 +- .../ContainerRegistryImagePushedEventData.cs | 5 +- ...BoxCopyCompletedEventData.Serialization.cs | 26 +- .../DataBoxCopyCompletedEventData.cs | 17 +- ...taBoxCopyStartedEventData.Serialization.cs | 26 +- .../Generated/DataBoxCopyStartedEventData.cs | 17 +- ...oxOrderCompletedEventData.Serialization.cs | 26 +- .../DataBoxOrderCompletedEventData.cs | 17 +- ...reatedOrUpdatedEventData.Serialization.cs} | 83 +- ...ridMqttClientCreatedOrUpdatedEventData.cs} | 30 +- ...ttClientDeletedEventData.Serialization.cs} | 42 +- ...=> EventGridMqttClientDeletedEventData.cs} | 10 +- ...EventGridMqttClientDisconnectionReason.cs} | 44 +- ...tGridMqttClientEventData.Serialization.cs} | 42 +- ...ata.cs => EventGridMqttClientEventData.cs} | 10 +- ...essionConnectedEventData.Serialization.cs} | 42 +- ...ridMqttClientSessionConnectedEventData.cs} | 10 +- ...ionDisconnectedEventData.Serialization.cs} | 57 +- ...MqttClientSessionDisconnectedEventData.cs} | 22 +- ...ntState.cs => EventGridMqttClientState.cs} | 26 +- .../EventGridSystemEventsModelFactory.cs | 234 +- ...ptureFileCreatedEventData.Serialization.cs | 26 +- .../EventHubCaptureFileCreatedEventData.cs | 17 +- ...rResourceCreatedEventData.Serialization.cs | 13 +- .../HealthcareFhirResourceCreatedEventData.cs | 13 +- ...rResourceDeletedEventData.Serialization.cs | 13 +- .../HealthcareFhirResourceDeletedEventData.cs | 13 +- ...rResourceUpdatedEventData.Serialization.cs | 13 +- .../HealthcareFhirResourceUpdatedEventData.cs | 13 +- ...setDriftDetectedEventData.Serialization.cs | 26 +- ...ngServicesDatasetDriftDetectedEventData.cs | 17 +- ...MediaJobCanceledEventData.Serialization.cs | 26 +- .../Generated/MediaJobCanceledEventData.cs | 6 +- ...ediaJobCancelingEventData.Serialization.cs | 26 +- .../Generated/MediaJobCancelingEventData.cs | 6 +- .../Generated/MediaJobError.Serialization.cs | 39 +- .../src/Generated/MediaJobError.cs | 16 +- .../MediaJobErroredEventData.Serialization.cs | 26 +- .../src/Generated/MediaJobErroredEventData.cs | 6 +- ...MediaJobFinishedEventData.Serialization.cs | 26 +- .../Generated/MediaJobFinishedEventData.cs | 6 +- .../Generated/MediaJobOutput.Serialization.cs | 7 +- .../src/Generated/MediaJobOutput.cs | 8 +- .../MediaJobOutputAsset.Serialization.cs | 13 +- .../src/Generated/MediaJobOutputAsset.cs | 5 +- ...obOutputCanceledEventData.Serialization.cs | 13 +- .../MediaJobOutputCanceledEventData.cs | 5 +- ...bOutputCancelingEventData.Serialization.cs | 13 +- .../MediaJobOutputCancelingEventData.cs | 5 +- ...JobOutputErroredEventData.Serialization.cs | 13 +- .../MediaJobOutputErroredEventData.cs | 5 +- ...obOutputFinishedEventData.Serialization.cs | 13 +- .../MediaJobOutputFinishedEventData.cs | 5 +- ...OutputProcessingEventData.Serialization.cs | 13 +- .../MediaJobOutputProcessingEventData.cs | 5 +- ...bOutputScheduledEventData.Serialization.cs | 13 +- .../MediaJobOutputScheduledEventData.cs | 5 +- ...utputStateChangeEventData.Serialization.cs | 13 +- .../MediaJobOutputStateChangeEventData.cs | 8 +- ...diaJobProcessingEventData.Serialization.cs | 26 +- .../Generated/MediaJobProcessingEventData.cs | 6 +- ...ediaJobScheduledEventData.Serialization.cs | 26 +- .../Generated/MediaJobScheduledEventData.cs | 6 +- ...iaJobStateChangeEventData.Serialization.cs | 26 +- .../Generated/MediaJobStateChangeEventData.cs | 12 +- ...ftTeamsAppIdentifierModel.Serialization.cs | 13 +- .../MicrosoftTeamsAppIdentifierModel.cs | 8 +- ...tTeamsUserIdentifierModel.Serialization.cs | 13 +- .../MicrosoftTeamsUserIdentifierModel.cs | 8 +- ...licyStateChangedEventData.Serialization.cs | 13 +- ...licyInsightsPolicyStateChangedEventData.cs | 13 +- ...licyStateCreatedEventData.Serialization.cs | 13 +- ...licyInsightsPolicyStateCreatedEventData.cs | 13 +- ...licyStateDeletedEventData.Serialization.cs | 13 +- ...licyInsightsPolicyStateDeletedEventData.cs | 13 +- ...ortRdbCompletedEventData.Serialization.cs} | 55 +- ...cs => RedisExportRdbCompletedEventData.cs} | 19 +- ...ortRdbCompletedEventData.Serialization.cs} | 55 +- ...cs => RedisImportRdbCompletedEventData.cs} | 19 +- ...atchingCompletedEventData.Serialization.cs | 13 +- .../RedisPatchingCompletedEventData.cs | 13 +- ...ScalingCompletedEventData.Serialization.cs | 13 +- .../RedisScalingCompletedEventData.cs | 13 +- ...cationsOperationalDetails.Serialization.cs | 13 +- ...ResourceNotificationsOperationalDetails.cs | 13 +- ...nectionConnectedEventData.Serialization.cs | 13 +- ...rviceClientConnectionConnectedEventData.cs | 13 +- ...tionDisconnectedEventData.Serialization.cs | 13 +- ...ceClientConnectionDisconnectedEventData.cs | 13 +- .../src/Generated/StorageBlobAccessTier.cs | 60 + ...orageBlobCreatedEventData.Serialization.cs | 9 + .../Generated/StorageBlobCreatedEventData.cs | 10 +- ...yPolicyCompletedEventData.Serialization.cs | 13 +- ...geBlobInventoryPolicyCompletedEventData.cs | 13 +- ...eBlobTierChangedEventData.Serialization.cs | 18 + .../StorageBlobTierChangedEventData.cs | 16 +- ...ignmentCompletedEventData.Serialization.cs | 26 +- ...StorageTaskAssignmentCompletedEventData.cs | 12 +- ...AssignmentQueuedEventData.Serialization.cs | 13 +- .../StorageTaskAssignmentQueuedEventData.cs | 13 +- ...ageTaskCompletedEventData.Serialization.cs | 26 +- .../StorageTaskCompletedEventData.cs | 12 +- ...torageTaskQueuedEventData.Serialization.cs | 13 +- .../Generated/StorageTaskQueuedEventData.cs | 13 +- .../Generated/SystemEventsClientOptions.cs | 8 +- .../UnknownMediaJobOutput.Serialization.cs | 13 +- .../src/Generated/UnknownMediaJobOutput.cs | 2 +- .../tsp-location.yaml | 7 +- .../Azure.Messaging.EventGrid.Namespaces.sln | 54 + .../Azure.Messaging.EventGridV2/CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../Azure.Messaging.EventGridV2/README.md | 107 + ...ing.EventGrid.Namespaces.netstandard2.0.cs | 212 ++ ...zure.Messaging.EventGrid.Namespaces.csproj | 20 + .../AcknowledgeRequest.Serialization.cs} | 97 +- .../src/Generated/AcknowledgeRequest.cs} | 37 +- .../AcknowledgeResult.Serialization.cs | 163 + .../src/Generated/AcknowledgeResult.cs | 83 + ...ssagingEventGridNamespacesClientOptions.cs | 40 + .../BrokerProperties.Serialization.cs | 143 + .../src/Generated/BrokerProperties.cs | 81 + .../src/Generated/CloudEvent.Serialization.cs | 255 ++ .../src/Generated/CloudEvent.cs | 164 + .../src/Generated/EventGridReceiverClient.cs | 840 +++++ .../src/Generated/EventGridSenderClient.cs | 375 +++ .../FailedLockToken.Serialization.cs | 143 + .../src/Generated/FailedLockToken.cs} | 45 +- .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 +++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/RequestContentHelper.cs | 136 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...ntGridNamespacesClientBuilderExtensions.cs | 73 + ...essagingEventGridNamespacesModelFactory.cs | 73 + .../Generated/PublishResult.Serialization.cs} | 64 +- .../src/Generated/PublishResult.cs} | 20 +- .../Generated/ReceiveDetails.Serialization.cs | 143 + .../src/Generated/ReceiveDetails.cs | 82 + .../Generated/ReceiveResult.Serialization.cs} | 70 +- .../src/Generated/ReceiveResult.cs} | 38 +- .../Generated/RejectRequest.Serialization.cs | 145 + .../src/Generated/RejectRequest.cs} | 34 +- .../Generated/RejectResult.Serialization.cs | 163 + .../src/Generated/RejectResult.cs | 83 + .../src/Generated/ReleaseDelay.cs | 60 + .../Generated/ReleaseRequest.Serialization.cs | 145 + .../src/Generated/ReleaseRequest.cs | 76 + .../Generated/ReleaseResult.Serialization.cs | 163 + .../src/Generated/ReleaseResult.cs | 83 + .../RenewLocksRequest.Serialization.cs | 145 + .../src/Generated/RenewLocksRequest.cs | 76 + .../RenewLocksResult.Serialization.cs} | 113 +- .../src/Generated/RenewLocksResult.cs | 83 + .../src/Properties/AssemblyInfo.cs | 11 + .../tsp-location.yaml | 4 + .../tsp-location.yaml | 5 +- 712 files changed, 26392 insertions(+), 53505 deletions(-) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/{Sample_AgentPoolSnapshotCollection.cs => Sample_FleetCollection.cs} (62%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberCollection.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberResource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetResource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_OSOptionProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunCollection.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetCollection.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{AgentPoolSnapshotData.Serialization.cs => FleetData.Serialization.cs} (54%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberCollection.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{ContainerServiceTrustedAccessRoleBindingData.Serialization.cs => FleetMemberData.Serialization.cs} (63%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.Serialization.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{ContainerServicePrivateEndpointConnectionResource.cs => FleetMemberResource.cs} (51%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.Serialization.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{ContainerServiceAgentPoolResource.cs => FleetResource.cs} (52%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyCollection.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{ContainerServicePrivateEndpointConnectionData.Serialization.cs => FleetUpdateStrategyData.Serialization.cs} (60%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.Serialization.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{ContainerServiceTrustedAccessRoleBindingResource.cs => FleetUpdateStrategyResource.cs} (53%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceAgentPoolOperationSource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceManagedClusterOperationSource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceTrustedAccessRoleBindingOperationSource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetOperationSource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ManagedClusterRunCommandResultOperationSource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortProtocol.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{AgentPoolUpgradeSettings.Serialization.cs => AgentProfile.Serialization.cs} (56%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{AgentPoolSnapshotListResult.cs => AgentProfile.cs} (66%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ClusterUpgradeSettings.Serialization.cs => ApiServerAccessProfile.Serialization.cs} (63%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{MeshRevisionProfileProperties.cs => ApiServerAccessProfile.cs} (69%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AutoScaleExpander.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLoadBalancerSku.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPlugin.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPluginMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSDiskType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionProvisioningState.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionStatus.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePublicNetworkAccess.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceStateCode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingProvisioningState.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceWeekDay.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterCredential.Serialization.cs => FleetCredentialResult.Serialization.cs} (65%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterCredential.cs => FleetCredentialResult.cs} (82%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{KubernetesPatchVersion.Serialization.cs => FleetCredentialResults.Serialization.cs} (62%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterCredentials.cs => FleetCredentialResults.cs} (69%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{MeshUpgradeProfileList.Serialization.cs => FleetListResult.Serialization.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{MeshUpgradeProfileList.cs => FleetListResult.cs} (60%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceIPTag.Serialization.cs => FleetMemberListResult.Serialization.cs} (56%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceSshPublicKey.cs => FleetMemberListResult.cs} (57%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceCreationData.Serialization.cs => FleetMemberPatch.Serialization.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ClusterUpgradeSettings.cs => FleetMemberPatch.cs} (71%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberProvisioningState.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTagsObject.Serialization.cs => FleetPatch.Serialization.cs} (61%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTagsObject.cs => FleetPatch.cs} (73%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetProvisioningState.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{KubernetesVersionCapabilities.Serialization.cs => FleetUpdateStrategyListResult.Serialization.cs} (57%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceSshConfiguration.cs => FleetUpdateStrategyListResult.cs} (56%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuInstanceProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IPFamily.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGatewayMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeConfigFormat.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletDiskType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesSupportPlan.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterKeyVaultNetworkAccessType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerBackendPoolType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuName.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuTier.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.Serialization.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterStorageProfileBlobCsiDriver.Serialization.cs => ManagedClusterUpdate.Serialization.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterRunCommandContent.cs => ManagedClusterUpdate.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{IstioCertificateAuthority.Serialization.cs => ManagedClusterUpgradeSpec.Serialization.cs} (58%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterPoolUpgradeProfileUpgradesItem.cs => ManagedClusterUpgradeSpec.cs} (61%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterDelegatedIdentity.Serialization.cs => ManagedServiceIdentity.Serialization.cs} (51%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentityType.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{MeshUpgradeProfileData.Serialization.cs => Models/MemberUpdateStatus.Serialization.cs} (53%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterSku.cs => MemberUpdateStatus.cs} (53%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NetworkDataplane.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ServiceMeshProfile.Serialization.cs => NodeImageSelection.Serialization.cs} (58%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{DailySchedule.cs => NodeImageSelection.cs} (63%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTimeSpan.Serialization.cs => NodeImageSelectionStatus.Serialization.cs} (58%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{KubernetesVersionListResult.cs => NodeImageSelectionStatus.cs} (66%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionType.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceSshPublicKey.Serialization.cs => NodeImageVersion.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServicePowerState.cs => NodeImageVersion.cs} (70%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleDownMode.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetPriority.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshMode.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServicePowerState.Serialization.cs => SkipProperties.Serialization.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ServiceMeshProfile.cs => SkipProperties.cs} (67%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SnapshotType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TargetType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterWorkloadAutoScalerProfileKeda.Serialization.cs => UpdateGroup.Serialization.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{CompatibleVersions.cs => UpdateGroup.cs} (61%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTrustedAccessRole.Serialization.cs => UpdateGroupStatus.Serialization.cs} (54%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServicePrivateLinkServiceConnectionState.cs => UpdateGroupStatus.cs} (61%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{IstioIngressGateway.Serialization.cs => UpdateRunListResult.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceMaintenanceConfigurationListResult.cs => UpdateRunListResult.cs} (58%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunProvisioningState.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{IstioComponents.Serialization.cs => UpdateRunStatus.Serialization.cs} (57%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceMaintenanceAbsoluteMonthlySchedule.cs => UpdateRunStatus.cs} (50%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ManagedClusterSku.Serialization.cs => UpdateRunStrategy.Serialization.cs} (57%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceOSOptionProperty.cs => UpdateRunStrategy.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTimeInWeek.Serialization.cs => UpdateStage.Serialization.cs} (54%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{KubernetesVersion.Serialization.cs => UpdateStageStatus.Serialization.cs} (53%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{UpgradeOverrideSettings.cs => UpdateStageStatus.cs} (54%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateState.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{MeshRevision.Serialization.cs => UpdateStatus.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceTimeSpan.cs => UpdateStatus.cs} (56%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeChannel.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{UpgradeOverrideSettings.Serialization.cs => WaitStatus.Serialization.cs} (55%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceCreationData.cs => WaitStatus.cs} (66%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsVmLicenseType.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WorkloadRuntime.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetMembersRestOperations.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/{TrustedAccessRoleBindingsRestOperations.cs => FleetUpdateStrategiesRestOperations.cs} (59%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/{AgentPoolsRestOperations.cs => FleetsRestOperations.cs} (51%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/UpdateRunsRestOperations.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunCollection.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{ContainerServiceMaintenanceConfigurationData.Serialization.cs => UpdateRunData.Serialization.cs} (56%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/Azure.ResourceManager.Contoso.sln create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/CHANGELOG.md create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/Directory.Build.props create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/README.md create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Azure.ResourceManager.Contoso.csproj create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/ArmContosoModelFactory.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeCollection.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.Serialization.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeData.Serialization.cs} (68%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeData.cs} (64%) create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeResource.Serialization.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeResource.cs} (61%) create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/ContosoExtensions.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoArmClient.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoResourceGroupResource.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoSubscriptionResource.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoTenantResource.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Argument.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Optional.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/ContosoArmOperation.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/ContosoArmOperationOfT.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/EmployeeOperationSource.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/ActionType.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.Serialization.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeListResult.Serialization.cs} (60%) create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeListResult.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeePatch.Serialization.cs} (56%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeePatch.cs} (62%) create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeProperties.Serialization.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeProperties.cs} (57%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.Serialization.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeUpdateProperties.Serialization.cs} (55%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeUpdateProperties.cs} (62%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.Serialization.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Operation.Serialization.cs} (51%) create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Operation.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationDisplay.Serialization.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationDisplay.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.Serialization.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationListResult.Serialization.cs} (53%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationListResult.cs} (65%) create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Origin.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/ProviderConstants.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/RestOperations/EmployeesRestOperations.cs} (68%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs => contoso/Azure.ResourceManager.Contoso/src/Generated/RestOperations/OperationsRestOperations.cs} (50%) create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/src/Properties/AssemblyInfo.cs create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/tests/Azure.ResourceManager.Contoso.Tests.csproj create mode 100644 sdk/contoso/Azure.ResourceManager.Contoso/tsp-location.yaml create mode 100644 sdk/contoso/ci.yml create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/Azure.Template.Contoso.sln create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/CHANGELOG.md create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/Directory.Build.props create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/README.md create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Azure.Template.Contoso.csproj create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Docs/Widgets.xml create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/FakedSharedModel.Serialization.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.cs => contosowidgetmanager/Azure.Template.Contoso/src/Generated/FakedSharedModel.cs} (58%) create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Argument.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Optional.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/OperationState.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/ResourceOperationStatusWidgetSuiteWidgetSuiteError.Serialization.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/ResourceOperationStatusWidgetSuiteWidgetSuiteError.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/TemplateContosoClientBuilderExtensions.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/TemplateContosoModelFactory.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetManagerClient.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetManagerClientOptions.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetSuite.Serialization.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetSuite.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Widgets.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/src/Properties/AssemblyInfo.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/tests/Azure.Template.Contoso.Tests.csproj create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/tests/Generated/Samples/Samples_Widgets.cs create mode 100644 sdk/contosowidgetmanager/Azure.Template.Contoso/tsp-location.yaml create mode 100644 sdk/contosowidgetmanager/ci.yml create mode 100644 sdk/developer-signing/Azure.Developer.Signing/tsp-location.yaml rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs => EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs} (72%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientCreatedOrUpdatedEventData.cs => EventGridMqttClientCreatedOrUpdatedEventData.cs} (66%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientDeletedEventData.Serialization.cs => EventGridMqttClientDeletedEventData.Serialization.cs} (77%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientDeletedEventData.cs => EventGridMqttClientDeletedEventData.cs} (81%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientDisconnectionReason.cs => EventGridMqttClientDisconnectionReason.cs} (64%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientEventData.Serialization.cs => EventGridMqttClientEventData.Serialization.cs} (78%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientEventData.cs => EventGridMqttClientEventData.cs} (93%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionConnectedEventData.Serialization.cs => EventGridMqttClientSessionConnectedEventData.Serialization.cs} (81%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionConnectedEventData.cs => EventGridMqttClientSessionConnectedEventData.cs} (88%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs => EventGridMqttClientSessionDisconnectedEventData.Serialization.cs} (77%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionDisconnectedEventData.cs => EventGridMqttClientSessionDisconnectedEventData.cs} (72%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientState.cs => EventGridMqttClientState.cs} (59%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisImportRDBCompletedEventData.Serialization.cs => RedisExportRdbCompletedEventData.Serialization.cs} (72%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisExportRDBCompletedEventData.cs => RedisExportRdbCompletedEventData.cs} (78%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisExportRDBCompletedEventData.Serialization.cs => RedisImportRdbCompletedEventData.Serialization.cs} (72%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisImportRDBCompletedEventData.cs => RedisImportRdbCompletedEventData.cs} (78%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/Azure.Messaging.EventGrid.Namespaces.sln create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/CHANGELOG.md create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/Directory.Build.props create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/README.md create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Azure.Messaging.EventGrid.Namespaces.csproj rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.Serialization.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.Serialization.cs} (54%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.cs} (63%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AzureMessagingEventGridNamespacesClientOptions.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridReceiverClient.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridSenderClient.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.Serialization.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.cs} (52%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Argument.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Optional.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/RequestContentHelper.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesClientBuilderExtensions.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesModelFactory.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.Serialization.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.Serialization.cs} (59%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.cs} (67%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.Serialization.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.Serialization.cs} (51%) rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.cs} (59%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.Serialization.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.cs} (60%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseDelay.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.Serialization.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.Serialization.cs} (51%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Properties/AssemblyInfo.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/tsp-location.yaml diff --git a/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml b/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml index 4076cbb60368..25b3b9cefb98 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml +++ b/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml @@ -1,5 +1,4 @@ -commit: 6a4cd586934a8478cc84c677afc49c4f149f8d87 directory: specification/communication/Communication.JobRouter -additionalDirectories: [] -repo: Azure/azure-rest-api-specs - +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/communication/Azure.Communication.Messages/tsp-location.yaml b/sdk/communication/Azure.Communication.Messages/tsp-location.yaml index 01b9db9a86ed..49a42feecf85 100644 --- a/sdk/communication/Azure.Communication.Messages/tsp-location.yaml +++ b/sdk/communication/Azure.Communication.Messages/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: b8ec3841224e5a9a27c128e588b1c387baef6a99 directory: specification/communication/Communication.Messages -additionalDirectories: [] -repo: Azure/azure-rest-api-specs +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml b/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml index bfe49dde41ae..c4f918b8ba21 100644 --- a/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml +++ b/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml @@ -1,5 +1,4 @@ -commit: 54cc502c020371277427a5e518b83fccb52452f5 -repo: Azure/azure-rest-api-specs directory: specification/confidentialledger/Microsoft.CodeTransparency -additionalDirectories: [] - +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs deleted file mode 100644 index 85da91d3b4d9..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_AgentPoolSnapshotResource - { - // List Snapshots - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAgentPoolSnapshots_ListSnapshots() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsList.json - // this example is just showing the usage of "Snapshots_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (AgentPoolSnapshotResource item in subscriptionResource.GetAgentPoolSnapshotsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AgentPoolSnapshotData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Get Snapshot - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetSnapshot() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json - // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AgentPoolSnapshotResource created on azure - // for more information of creating AgentPoolSnapshotResource, please refer to the document of AgentPoolSnapshotResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "snapshot1"; - ResourceIdentifier agentPoolSnapshotResourceId = AgentPoolSnapshotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - AgentPoolSnapshotResource agentPoolSnapshot = client.GetAgentPoolSnapshotResource(agentPoolSnapshotResourceId); - - // invoke the operation - AgentPoolSnapshotResource result = await agentPoolSnapshot.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AgentPoolSnapshotData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Update Snapshot Tags - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdateSnapshotTags() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsUpdateTags.json - // this example is just showing the usage of "Snapshots_UpdateTags" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AgentPoolSnapshotResource created on azure - // for more information of creating AgentPoolSnapshotResource, please refer to the document of AgentPoolSnapshotResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "snapshot1"; - ResourceIdentifier agentPoolSnapshotResourceId = AgentPoolSnapshotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - AgentPoolSnapshotResource agentPoolSnapshot = client.GetAgentPoolSnapshotResource(agentPoolSnapshotResourceId); - - // invoke the operation - ContainerServiceTagsObject containerServiceTagsObject = new ContainerServiceTagsObject() - { - Tags = -{ -["key2"] = "new-val2", -["key3"] = "val3", -}, - }; - AgentPoolSnapshotResource result = await agentPoolSnapshot.UpdateAsync(containerServiceTagsObject); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AgentPoolSnapshotData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Delete Snapshot - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteSnapshot() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsDelete.json - // this example is just showing the usage of "Snapshots_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AgentPoolSnapshotResource created on azure - // for more information of creating AgentPoolSnapshotResource, please refer to the document of AgentPoolSnapshotResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "snapshot1"; - ResourceIdentifier agentPoolSnapshotResourceId = AgentPoolSnapshotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - AgentPoolSnapshotResource agentPoolSnapshot = client.GetAgentPoolSnapshotResource(agentPoolSnapshotResourceId); - - // invoke the operation - await agentPoolSnapshot.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs deleted file mode 100644 index 51a85ec9943c..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_AgentPoolUpgradeProfileResource - { - // Get Upgrade Profile for Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetUpgradeProfileForAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGetUpgradeProfile.json - // this example is just showing the usage of "AgentPools_GetUpgradeProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AgentPoolUpgradeProfileResource created on azure - // for more information of creating AgentPoolUpgradeProfileResource, please refer to the document of AgentPoolUpgradeProfileResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier agentPoolUpgradeProfileResourceId = AgentPoolUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - AgentPoolUpgradeProfileResource agentPoolUpgradeProfile = client.GetAgentPoolUpgradeProfileResource(agentPoolUpgradeProfileResourceId); - - // invoke the operation - AgentPoolUpgradeProfileResource result = await agentPoolUpgradeProfile.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AgentPoolUpgradeProfileData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs deleted file mode 100644 index 7b21e704d8cc..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs +++ /dev/null @@ -1,1067 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServiceAgentPoolCollection - { - // List Agent Pools by Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListAgentPoolsByManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsList.json - // this example is just showing the usage of "AgentPools_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation and iterate over the result - await foreach (ContainerServiceAgentPoolResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Get Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json - // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolResource result = await collection.GetAsync(agentPoolName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json - // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - bool result = await collection.ExistsAsync(agentPoolName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json - // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - NullableResponse response = await collection.GetIfExistsAsync(agentPoolName); - ContainerServiceAgentPoolResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // Create Agent Pool using an agent pool snapshot - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolUsingAnAgentPoolSnapshot() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Snapshot.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - EnableFips = true, - CreationDataSourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Capacity Reservation Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithCapacityReservationGroup() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CRG.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - CapacityReservationGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Dedicated Host Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithDedicatedHostGroup() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - HostGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with EncryptionAtHost enabled - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithEncryptionAtHostEnabled() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - EnableEncryptionAtHost = true, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Ephemeral OS Disk - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithEphemeralOSDisk() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Ephemeral.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSDiskSizeInGB = 64, - OSDiskType = ContainerServiceOSDiskType.Ephemeral, - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with FIPS enabled OS - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithFIPSEnabledOS() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableFIPS.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - EnableFips = true, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with GPUMIG - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithGPUMIG() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_GPUMIG.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_ND96asr_v4", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - KubeletConfig = new KubeletConfig() - { - CpuManagerPolicy = "static", - IsCpuCfsQuotaEnabled = true, - CpuCfsQuotaPeriod = "200ms", - ImageGcHighThreshold = 90, - ImageGcLowThreshold = 70, - TopologyManagerPolicy = "best-effort", - AllowedUnsafeSysctls = -{ -"kernel.msg*","net.core.somaxconn" -}, - FailStartWithSwapOn = false, - }, - LinuxOSConfig = new LinuxOSConfig() - { - Sysctls = new SysctlConfig() - { - NetCoreWmemDefault = 12345, - NetIPv4TcpTwReuse = true, - NetIPv4IPLocalPortRange = "20000 60000", - KernelThreadsMax = 99999, - }, - TransparentHugePageEnabled = "always", - TransparentHugePageDefrag = "madvise", - SwapFileSizeInMB = 1500, - }, - GpuInstanceProfile = GpuInstanceProfile.Mig2G, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Krustlet and the WASI runtime - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithKrustletAndTheWASIRuntime() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WasmWasi.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSDiskSizeInGB = 64, - WorkloadRuntime = WorkloadRuntime.WasmWasi, - OSType = ContainerServiceOSType.Linux, - Mode = AgentPoolMode.User, - OrchestratorVersion = "", - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with KubeletConfig and LinuxOSConfig - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - KubeletConfig = new KubeletConfig() - { - CpuManagerPolicy = "static", - IsCpuCfsQuotaEnabled = true, - CpuCfsQuotaPeriod = "200ms", - ImageGcHighThreshold = 90, - ImageGcLowThreshold = 70, - TopologyManagerPolicy = "best-effort", - AllowedUnsafeSysctls = -{ -"kernel.msg*","net.core.somaxconn" -}, - FailStartWithSwapOn = false, - }, - LinuxOSConfig = new LinuxOSConfig() - { - Sysctls = new SysctlConfig() - { - NetCoreWmemDefault = 12345, - NetIPv4TcpTwReuse = true, - NetIPv4IPLocalPortRange = "20000 60000", - KernelThreadsMax = 99999, - }, - TransparentHugePageEnabled = "always", - TransparentHugePageDefrag = "madvise", - SwapFileSizeInMB = 1500, - }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with OSSKU - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithOSSKU() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_OSSKU.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OSSku = ContainerServiceOSSku.AzureLinux, - OrchestratorVersion = "", - KubeletConfig = new KubeletConfig() - { - CpuManagerPolicy = "static", - IsCpuCfsQuotaEnabled = true, - CpuCfsQuotaPeriod = "200ms", - ImageGcHighThreshold = 90, - ImageGcLowThreshold = 70, - TopologyManagerPolicy = "best-effort", - AllowedUnsafeSysctls = -{ -"kernel.msg*","net.core.somaxconn" -}, - FailStartWithSwapOn = false, - }, - LinuxOSConfig = new LinuxOSConfig() - { - Sysctls = new SysctlConfig() - { - NetCoreWmemDefault = 12345, - NetIPv4TcpTwReuse = true, - NetIPv4IPLocalPortRange = "20000 60000", - KernelThreadsMax = 99999, - }, - TransparentHugePageEnabled = "always", - TransparentHugePageDefrag = "madvise", - SwapFileSizeInMB = 1500, - }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with PPG - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithPPG() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_PPG.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - ProximityPlacementGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with UltraSSD enabled - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithUltraSSDEnabled() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - EnableUltraSsd = true, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Windows OSSKU - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateAgentPoolWithWindowsOSSKU() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "wnp2"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_D4s_v3", - OSType = ContainerServiceOSType.Windows, - OSSku = ContainerServiceOSSku.Windows2022, - OrchestratorVersion = "1.23.3", - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Spot Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateSpotAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Spot.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS1_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - ScaleSetPriority = ScaleSetPriority.Spot, - ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete, - Tags = -{ -["name1"] = "val1", -}, - NodeLabels = -{ -["key1"] = "val1", -}, - NodeTaints = -{ -"Key1=Value1:NoSchedule" -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Update.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS1_v2", - OSType = ContainerServiceOSType.Linux, - Mode = AgentPoolMode.User, - OrchestratorVersion = "", - ScaleSetPriority = ScaleSetPriority.Spot, - ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete, - Tags = -{ -["name1"] = "val1", -}, - NodeLabels = -{ -["key1"] = "val1", -}, - NodeTaints = -{ -"Key1=Value1:NoSchedule" -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Start Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_StartAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Start.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - PowerStateCode = ContainerServiceStateCode.Running, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Stop Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_StopAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Stop.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - PowerStateCode = ContainerServiceStateCode.Stopped, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Update Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_UpdateAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Update.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceAgentPoolResource - ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); - - // invoke the operation - string agentPoolName = "agentpool1"; - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS1_v2", - OSType = ContainerServiceOSType.Linux, - MaxCount = 2, - MinCount = 2, - EnableAutoScaling = true, - OrchestratorVersion = "", - ScaleSetPriority = ScaleSetPriority.Spot, - ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete, - NodeTaints = -{ -"Key1=Value1:NoSchedule" -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs deleted file mode 100644 index 7f4a5fba28b0..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs +++ /dev/null @@ -1,983 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServiceAgentPoolResource - { - // Abort operation on agent pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task AbortLatestOperation_AbortOperationOnAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsAbortOperation.json - // this example is just showing the usage of "AgentPools_AbortLatestOperation" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - await containerServiceAgentPool.AbortLatestOperationAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Get Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json - // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolResource result = await containerServiceAgentPool.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool using an agent pool snapshot - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolUsingAnAgentPoolSnapshot() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Snapshot.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - EnableFips = true, - CreationDataSourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Capacity Reservation Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithCapacityReservationGroup() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CRG.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - CapacityReservationGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"), - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Dedicated Host Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithDedicatedHostGroup() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - HostGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with EncryptionAtHost enabled - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithEncryptionAtHostEnabled() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - EnableEncryptionAtHost = true, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Ephemeral OS Disk - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithEphemeralOSDisk() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Ephemeral.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSDiskSizeInGB = 64, - OSDiskType = ContainerServiceOSDiskType.Ephemeral, - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with FIPS enabled OS - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithFIPSEnabledOS() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableFIPS.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - EnableFips = true, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with GPUMIG - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithGPUMIG() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_GPUMIG.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_ND96asr_v4", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - KubeletConfig = new KubeletConfig() - { - CpuManagerPolicy = "static", - IsCpuCfsQuotaEnabled = true, - CpuCfsQuotaPeriod = "200ms", - ImageGcHighThreshold = 90, - ImageGcLowThreshold = 70, - TopologyManagerPolicy = "best-effort", - AllowedUnsafeSysctls = -{ -"kernel.msg*","net.core.somaxconn" -}, - FailStartWithSwapOn = false, - }, - LinuxOSConfig = new LinuxOSConfig() - { - Sysctls = new SysctlConfig() - { - NetCoreWmemDefault = 12345, - NetIPv4TcpTwReuse = true, - NetIPv4IPLocalPortRange = "20000 60000", - KernelThreadsMax = 99999, - }, - TransparentHugePageEnabled = "always", - TransparentHugePageDefrag = "madvise", - SwapFileSizeInMB = 1500, - }, - GpuInstanceProfile = GpuInstanceProfile.Mig2G, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Krustlet and the WASI runtime - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithKrustletAndTheWASIRuntime() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WasmWasi.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSDiskSizeInGB = 64, - WorkloadRuntime = WorkloadRuntime.WasmWasi, - OSType = ContainerServiceOSType.Linux, - Mode = AgentPoolMode.User, - OrchestratorVersion = "", - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with KubeletConfig and LinuxOSConfig - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - KubeletConfig = new KubeletConfig() - { - CpuManagerPolicy = "static", - IsCpuCfsQuotaEnabled = true, - CpuCfsQuotaPeriod = "200ms", - ImageGcHighThreshold = 90, - ImageGcLowThreshold = 70, - TopologyManagerPolicy = "best-effort", - AllowedUnsafeSysctls = -{ -"kernel.msg*","net.core.somaxconn" -}, - FailStartWithSwapOn = false, - }, - LinuxOSConfig = new LinuxOSConfig() - { - Sysctls = new SysctlConfig() - { - NetCoreWmemDefault = 12345, - NetIPv4TcpTwReuse = true, - NetIPv4IPLocalPortRange = "20000 60000", - KernelThreadsMax = 99999, - }, - TransparentHugePageEnabled = "always", - TransparentHugePageDefrag = "madvise", - SwapFileSizeInMB = 1500, - }, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with OSSKU - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithOSSKU() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_OSSKU.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OSSku = ContainerServiceOSSku.AzureLinux, - OrchestratorVersion = "", - KubeletConfig = new KubeletConfig() - { - CpuManagerPolicy = "static", - IsCpuCfsQuotaEnabled = true, - CpuCfsQuotaPeriod = "200ms", - ImageGcHighThreshold = 90, - ImageGcLowThreshold = 70, - TopologyManagerPolicy = "best-effort", - AllowedUnsafeSysctls = -{ -"kernel.msg*","net.core.somaxconn" -}, - FailStartWithSwapOn = false, - }, - LinuxOSConfig = new LinuxOSConfig() - { - Sysctls = new SysctlConfig() - { - NetCoreWmemDefault = 12345, - NetIPv4TcpTwReuse = true, - NetIPv4IPLocalPortRange = "20000 60000", - KernelThreadsMax = 99999, - }, - TransparentHugePageEnabled = "always", - TransparentHugePageDefrag = "madvise", - SwapFileSizeInMB = 1500, - }, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with PPG - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithPPG() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_PPG.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - ProximityPlacementGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with UltraSSD enabled - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithUltraSSDEnabled() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS2_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - EnableUltraSsd = true, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Agent Pool with Windows OSSKU - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateAgentPoolWithWindowsOSSKU() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "wnp2"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_D4s_v3", - OSType = ContainerServiceOSType.Windows, - OSSku = ContainerServiceOSSku.Windows2022, - OrchestratorVersion = "1.23.3", - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Spot Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateSpotAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Spot.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS1_v2", - OSType = ContainerServiceOSType.Linux, - OrchestratorVersion = "", - ScaleSetPriority = ScaleSetPriority.Spot, - ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete, - Tags = -{ -["name1"] = "val1", -}, - NodeLabels = -{ -["key1"] = "val1", -}, - NodeTaints = -{ -"Key1=Value1:NoSchedule" -}, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateUpdateAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Update.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS1_v2", - OSType = ContainerServiceOSType.Linux, - Mode = AgentPoolMode.User, - OrchestratorVersion = "", - ScaleSetPriority = ScaleSetPriority.Spot, - ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete, - Tags = -{ -["name1"] = "val1", -}, - NodeLabels = -{ -["key1"] = "val1", -}, - NodeTaints = -{ -"Key1=Value1:NoSchedule" -}, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Start Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_StartAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Start.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - PowerStateCode = ContainerServiceStateCode.Running, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Stop Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_StopAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Stop.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - PowerStateCode = ContainerServiceStateCode.Stopped, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Update Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdateAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Update.json - // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData() - { - Count = 3, - VmSize = "Standard_DS1_v2", - OSType = ContainerServiceOSType.Linux, - MaxCount = 2, - MinCount = 2, - EnableAutoScaling = true, - OrchestratorVersion = "", - ScaleSetPriority = ScaleSetPriority.Spot, - ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete, - NodeTaints = -{ -"Key1=Value1:NoSchedule" -}, - }; - ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceAgentPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceAgentPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Delete Agent Pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsDelete.json - // this example is just showing the usage of "AgentPools_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - await containerServiceAgentPool.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Upgrade Agent Pool Node Image Version - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task UpgradeNodeImageVersion_UpgradeAgentPoolNodeImageVersion() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsUpgradeNodeImageVersion.json - // this example is just showing the usage of "AgentPools_UpgradeNodeImageVersion" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceAgentPoolResource created on azure - // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string agentPoolName = "agentpool1"; - ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); - ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); - - // invoke the operation - await containerServiceAgentPool.UpgradeNodeImageVersionAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs deleted file mode 100644 index 519813677639..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs +++ /dev/null @@ -1,419 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServiceMaintenanceConfigurationCollection - { - // List maintenance configurations by Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListMaintenanceConfigurationsByManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsList.json - // this example is just showing the usage of "MaintenanceConfigurations_ListByManagedCluster" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation and iterate over the result - await foreach (ContainerServiceMaintenanceConfigurationResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // List maintenance configurations configured with maintenance window by Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListMaintenanceConfigurationsConfiguredWithMaintenanceWindowByManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json - // this example is just showing the usage of "MaintenanceConfigurations_ListByManagedCluster" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation and iterate over the result - await foreach (ContainerServiceMaintenanceConfigurationResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Get Maintenance Configuration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetMaintenanceConfiguration() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json - // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation - string configName = "default"; - ContainerServiceMaintenanceConfigurationResource result = await collection.GetAsync(configName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get Maintenance Configuration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetMaintenanceConfiguration() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json - // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation - string configName = "default"; - bool result = await collection.ExistsAsync(configName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Maintenance Configuration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetMaintenanceConfiguration() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json - // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation - string configName = "default"; - NullableResponse response = await collection.GetIfExistsAsync(configName); - ContainerServiceMaintenanceConfigurationResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // Get Maintenance Configuration Configured With Maintenance Window - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json - // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation - string configName = "aksManagedNodeOSUpgradeSchedule"; - ContainerServiceMaintenanceConfigurationResource result = await collection.GetAsync(configName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get Maintenance Configuration Configured With Maintenance Window - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json - // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation - string configName = "aksManagedNodeOSUpgradeSchedule"; - bool result = await collection.ExistsAsync(configName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Maintenance Configuration Configured With Maintenance Window - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json - // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation - string configName = "aksManagedNodeOSUpgradeSchedule"; - NullableResponse response = await collection.GetIfExistsAsync(configName); - ContainerServiceMaintenanceConfigurationResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // Create/Update Maintenance Configuration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateMaintenanceConfiguration() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update.json - // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation - string configName = "default"; - ContainerServiceMaintenanceConfigurationData data = new ContainerServiceMaintenanceConfigurationData() - { - TimesInWeek = -{ -new ContainerServiceTimeInWeek() -{ -Day = ContainerServiceWeekDay.Monday, -HourSlots = -{ -1,2 -}, -} -}, - NotAllowedTimes = -{ -new ContainerServiceTimeSpan() -{ -StartOn = DateTimeOffset.Parse("2020-11-26T03:00:00Z"), -EndOn = DateTimeOffset.Parse("2020-11-30T12:00:00Z"), -} -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configName, data); - ContainerServiceMaintenanceConfigurationResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Maintenance Configuration with Maintenance Window - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateMaintenanceConfigurationWithMaintenanceWindow() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json - // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceMaintenanceConfigurationResource - ContainerServiceMaintenanceConfigurationCollection collection = containerServiceManagedCluster.GetContainerServiceMaintenanceConfigurations(); - - // invoke the operation - string configName = "aksManagedAutoUpgradeSchedule"; - ContainerServiceMaintenanceConfigurationData data = new ContainerServiceMaintenanceConfigurationData() - { - MaintenanceWindow = new ContainerServiceMaintenanceWindow(new ContainerServiceMaintenanceSchedule() - { - RelativeMonthly = new ContainerServiceMaintenanceRelativeMonthlySchedule(3, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.First, ContainerServiceWeekDay.Monday), - }, 10, "08:30") - { - UtcOffset = "+05:30", - StartDate = "2023-01-01", - NotAllowedDates = -{ -new ContainerServiceDateSpan(DateTimeOffset.Parse("2023-02-18"),DateTimeOffset.Parse("2023-02-25")),new ContainerServiceDateSpan(DateTimeOffset.Parse("2023-12-23"),DateTimeOffset.Parse("2024-01-05")) -}, - }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configName, data); - ContainerServiceMaintenanceConfigurationResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs deleted file mode 100644 index e944fd8a1db7..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServiceMaintenanceConfigurationResource - { - // Get Maintenance Configuration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetMaintenanceConfiguration() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json - // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceMaintenanceConfigurationResource created on azure - // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string configName = "default"; - ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName); - ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId); - - // invoke the operation - ContainerServiceMaintenanceConfigurationResource result = await containerServiceMaintenanceConfiguration.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get Maintenance Configuration Configured With Maintenance Window - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json - // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceMaintenanceConfigurationResource created on azure - // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string configName = "aksManagedNodeOSUpgradeSchedule"; - ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName); - ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId); - - // invoke the operation - ContainerServiceMaintenanceConfigurationResource result = await containerServiceMaintenanceConfiguration.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Maintenance Configuration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateUpdateMaintenanceConfiguration() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update.json - // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceMaintenanceConfigurationResource created on azure - // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string configName = "default"; - ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName); - ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId); - - // invoke the operation - ContainerServiceMaintenanceConfigurationData data = new ContainerServiceMaintenanceConfigurationData() - { - TimesInWeek = -{ -new ContainerServiceTimeInWeek() -{ -Day = ContainerServiceWeekDay.Monday, -HourSlots = -{ -1,2 -}, -} -}, - NotAllowedTimes = -{ -new ContainerServiceTimeSpan() -{ -StartOn = DateTimeOffset.Parse("2020-11-26T03:00:00Z"), -EndOn = DateTimeOffset.Parse("2020-11-30T12:00:00Z"), -} -}, - }; - ArmOperation lro = await containerServiceMaintenanceConfiguration.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceMaintenanceConfigurationResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Maintenance Configuration with Maintenance Window - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateUpdateMaintenanceConfigurationWithMaintenanceWindow() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json - // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceMaintenanceConfigurationResource created on azure - // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string configName = "aksManagedAutoUpgradeSchedule"; - ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName); - ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId); - - // invoke the operation - ContainerServiceMaintenanceConfigurationData data = new ContainerServiceMaintenanceConfigurationData() - { - MaintenanceWindow = new ContainerServiceMaintenanceWindow(new ContainerServiceMaintenanceSchedule() - { - RelativeMonthly = new ContainerServiceMaintenanceRelativeMonthlySchedule(3, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.First, ContainerServiceWeekDay.Monday), - }, 10, "08:30") - { - UtcOffset = "+05:30", - StartDate = "2023-01-01", - NotAllowedDates = -{ -new ContainerServiceDateSpan(DateTimeOffset.Parse("2023-02-18"),DateTimeOffset.Parse("2023-02-25")),new ContainerServiceDateSpan(DateTimeOffset.Parse("2023-12-23"),DateTimeOffset.Parse("2024-01-05")) -}, - }, - }; - ArmOperation lro = await containerServiceMaintenanceConfiguration.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceMaintenanceConfigurationResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceMaintenanceConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Delete Maintenance Configuration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteMaintenanceConfiguration() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsDelete.json - // this example is just showing the usage of "MaintenanceConfigurations_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceMaintenanceConfigurationResource created on azure - // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string configName = "default"; - ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName); - ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId); - - // invoke the operation - await containerServiceMaintenanceConfiguration.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Delete Maintenance Configuration For Node OS Upgrade - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteMaintenanceConfigurationForNodeOSUpgrade() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json - // this example is just showing the usage of "MaintenanceConfigurations_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceMaintenanceConfigurationResource created on azure - // for more information of creating ContainerServiceMaintenanceConfigurationResource, please refer to the document of ContainerServiceMaintenanceConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string configName = "aksManagedNodeOSUpgradeSchedule"; - ResourceIdentifier containerServiceMaintenanceConfigurationResourceId = ContainerServiceMaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, configName); - ContainerServiceMaintenanceConfigurationResource containerServiceMaintenanceConfiguration = client.GetContainerServiceMaintenanceConfigurationResource(containerServiceMaintenanceConfigurationResourceId); - - // invoke the operation - await containerServiceMaintenanceConfiguration.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs deleted file mode 100644 index 9a1c4cb74427..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs +++ /dev/null @@ -1,2858 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServiceManagedClusterCollection - { - // Get Managed Clusters by Resource Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_GetManagedClustersByResourceGroup() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListByResourceGroup.json - // this example is just showing the usage of "ManagedClusters_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation and iterate over the result - await foreach (ContainerServiceManagedClusterResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Get Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json - // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterResource result = await collection.GetAsync(resourceName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json - // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - bool result = await collection.ExistsAsync(resourceName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json - // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - NullableResponse response = await collection.GetIfExistsAsync(resourceName); - ContainerServiceManagedClusterResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // Create Managed Cluster using an agent pool snapshot - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterUsingAnAgentPoolSnapshot() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Snapshot.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -EnableFips = true, -CreationDataSourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = false, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with AKS-managed NAT gateway as outbound type - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithAKSManagedNATGatewayAsOutboundType() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_ManagedNATGateway.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = false, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.ManagedNatGateway, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - NatGatewayProfile = new ManagedClusterNatGatewayProfile() - { - ManagedOutboundIPCount = 2, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with Azure KeyVault Secrets Provider Addon - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithAzureKeyVaultSecretsProviderAddon() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -["azureKeyvaultSecretsProvider"] = new ManagedClusterAddonProfile(true) -{ -Config = -{ -["enableSecretRotation"] = "true", -["rotationPollInterval"] = "2m", -}, -}, -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with Capacity Reservation Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithCapacityReservationGroup() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_CRG.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -CapacityReservationGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1"), -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with Dedicated Host Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithDedicatedHostGroup() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DedicatedHostGroup.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -EnableNodePublicIP = true, -HostGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = false, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with EncryptionAtHost enabled - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithEncryptionAtHostEnabled() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -EnableEncryptionAtHost = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with FIPS enabled OS - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithFIPSEnabledOS() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnabledFIPS.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -EnableFips = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = false, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with GPUMIG - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithGPUMIG() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_GPUMIG.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_ND96asr_v4", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -GpuInstanceProfile = GpuInstanceProfile.Mig3G, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - HttpProxyConfig = new ManagedClusterHttpProxyConfig() - { - HttpProxy = "http://myproxy.server.com:8080", - HttpsProxy = "https://myproxy.server.com:8080", - NoProxy = -{ -"localhost","127.0.0.1" -}, - TrustedCA = "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=", - }, - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with HTTP proxy configured - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithHTTPProxyConfigured() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_HTTPProxy.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - HttpProxyConfig = new ManagedClusterHttpProxyConfig() - { - HttpProxy = "http://myproxy.server.com:8080", - HttpsProxy = "https://myproxy.server.com:8080", - NoProxy = -{ -"localhost","127.0.0.1" -}, - TrustedCA = "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=", - }, - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with LongTermSupport - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithLongTermSupport() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Premium.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = ManagedClusterSkuName.Base, - Tier = ManagedClusterSkuTier.Premium, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -EnableEncryptionAtHost = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - SupportPlan = KubernetesSupportPlan.AKSLongTermSupport, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - ApiServerAccessProfile = new ManagedClusterApiServerAccessProfile() - { - DisableRunCommand = true, - }, - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with Node Public IP Prefix - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithNodePublicIPPrefix() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -NodePublicIPPrefixId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix"), -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with OSSKU - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithOSSKU() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_OSSKU.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -OSSku = ContainerServiceOSSku.AzureLinux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - HttpProxyConfig = new ManagedClusterHttpProxyConfig() - { - HttpProxy = "http://myproxy.server.com:8080", - HttpsProxy = "https://myproxy.server.com:8080", - NoProxy = -{ -"localhost","127.0.0.1" -}, - TrustedCA = "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=", - }, - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with PPG - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithPPG() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PPG.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -ProximityPlacementGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with PodIdentity enabled - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithPodIdentityEnabled() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PodIdentity.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - PodIdentityProfile = new ManagedClusterPodIdentityProfile() - { - IsEnabled = true, - AllowNetworkPluginKubenet = true, - }, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with RunCommand disabled - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithRunCommandDisabled() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DisableRunCommand.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -EnableEncryptionAtHost = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - ApiServerAccessProfile = new ManagedClusterApiServerAccessProfile() - { - DisableRunCommand = true, - }, - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with Security Profile configured - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithSecurityProfileConfigured() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_SecurityProfile.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - SecurityProfile = new ManagedClusterSecurityProfile() - { - Defender = new ManagedClusterSecurityProfileDefender() - { - LogAnalyticsWorkspaceResourceId = new ResourceIdentifier("/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"), - IsSecurityMonitoringEnabled = true, - }, - IsWorkloadIdentityEnabled = true, - }, - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with UltraSSD enabled - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithUltraSSDEnabled() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnableUltraSSD.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -EnableUltraSsd = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Cluster with user-assigned NAT gateway as outbound type - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedClusterWithUserAssignedNATGatewayAsOutboundType() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = false, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.UserAssignedNatGateway, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Private Cluster with Public FQDN specified - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedPrivateClusterWithPublicFQDNSpecified() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -EnableEncryptionAtHost = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - ApiServerAccessProfile = new ManagedClusterApiServerAccessProfile() - { - EnablePrivateCluster = true, - EnablePrivateClusterPublicFqdn = true, - }, - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create Managed Private Cluster with fqdn subdomain specified - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateManagedPrivateClusterWithFqdnSubdomainSpecified() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - FqdnSubdomain = "domain1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -EnableEncryptionAtHost = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - ApiServerAccessProfile = new ManagedClusterApiServerAccessProfile() - { - EnablePrivateCluster = true, - PrivateDnsZone = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io", - }, - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update AAD Managed Cluster with EnableAzureRBAC - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateAADManagedClusterWithEnableAzureRBAC() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS1_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -AvailabilityZones = -{ -"1","2","3" -}, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AadProfile = new ManagedClusterAadProfile() - { - IsManagedAadEnabled = true, - IsAzureRbacEnabled = true, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Update.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - ClusterIdentity = new ManagedClusterIdentity() - { - ResourceIdentityType = "UserAssigned", - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")] = new UserAssignedIdentity(), -}, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS1_v2", -OSType = ContainerServiceOSType.Linux, -ScaleDownMode = ScaleDownMode.Deallocate, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -AvailabilityZones = -{ -"1","2","3" -}, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - UpgradeOverrideSettings = new UpgradeOverrideSettings() - { - ForceUpgrade = false, - Until = DateTimeOffset.Parse("2022-11-01T13:00:00Z"), - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - BalanceSimilarNodeGroups = "true", - Expander = AutoScaleExpander.Priority, - MaxNodeProvisionTime = "15m", - NewPodScaleUpDelay = "1m", - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - SkipNodesWithSystemPods = "false", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Managed Cluster with Azure Service Mesh - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateManagedClusterWithAzureServiceMesh() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_AzureServiceMesh.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS2_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -["azureKeyvaultSecretsProvider"] = new ManagedClusterAddonProfile(true) -{ -Config = -{ -["enableSecretRotation"] = "true", -["rotationPollInterval"] = "2m", -}, -}, -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - ServiceMeshProfile = new ServiceMeshProfile(ServiceMeshMode.Istio) - { - Istio = new IstioServiceMesh() - { - Components = new IstioComponents() - { - IngressGateways = -{ -new IstioIngressGateway(IstioIngressGatewayMode.Internal,true) -}, - EgressGateways = -{ -new IstioEgressGateway(true) -{ -NodeSelector = -{ -["istio"] = "egress", -}, -} -}, - }, - CertificateAuthorityPlugin = new IstioPluginCertificateAuthority() - { - KeyVaultId = new ResourceIdentifier("/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv"), - CertObjectName = "ca-cert", - KeyObjectName = "ca-key", - RootCertObjectName = "root-cert", - CertChainObjectName = "cert-chain", - }, - }, - }, - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Managed Cluster with EnableAHUB - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateManagedClusterWithEnableAHUB() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWithAHUB.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - ClusterIdentity = new ManagedClusterIdentity() - { - ResourceIdentityType = "UserAssigned", - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")] = new UserAssignedIdentity(), -}, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS1_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -AvailabilityZones = -{ -"1","2","3" -}, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - LicenseType = WindowsVmLicenseType.WindowsServer, - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Managed Cluster with Windows gMSA enabled - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateManagedClusterWithWindowsGMSAEnabled() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - ClusterIdentity = new ManagedClusterIdentity() - { - ResourceIdentityType = "UserAssigned", - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")] = new UserAssignedIdentity(), -}, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS1_v2", -OSType = ContainerServiceOSType.Linux, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -AvailabilityZones = -{ -"1","2","3" -}, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - GmsaProfile = new WindowsGmsaProfile() - { - IsEnabled = true, - }, - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create/Update Managed Cluster with dual-stack networking - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateManagedClusterWithDualStackNetworking() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DualStackNetworking.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this ContainerServiceManagedClusterResource - ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); - - // invoke the operation - string resourceName = "clustername1"; - ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) - { - Sku = new ManagedClusterSku() - { - Name = new ManagedClusterSkuName("Basic"), - Tier = ManagedClusterSkuTier.Free, - }, - ClusterIdentity = new ManagedClusterIdentity() - { - ResourceIdentityType = "UserAssigned", - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")] = new UserAssignedIdentity(), -}, - }, - KubernetesVersion = "", - DnsPrefix = "dnsprefix1", - AgentPoolProfiles = -{ -new ManagedClusterAgentPoolProfile("nodepool1") -{ -Count = 3, -VmSize = "Standard_DS1_v2", -OSType = ContainerServiceOSType.Linux, -ScaleDownMode = ScaleDownMode.Deallocate, -AgentPoolType = AgentPoolType.VirtualMachineScaleSets, -Mode = AgentPoolMode.System, -AvailabilityZones = -{ -"1","2","3" -}, -EnableNodePublicIP = true, -} -}, - LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] - { -new ContainerServiceSshPublicKey("keydata") - })), - WindowsProfile = new ManagedClusterWindowsProfile("azureuser") - { - AdminPassword = "replacePassword1234$", - }, - ServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }, - AddonProfiles = -{ -}, - EnableRbac = true, - EnablePodSecurityPolicy = true, - NetworkProfile = new ContainerServiceNetworkProfile() - { - OutboundType = ContainerServiceOutboundType.LoadBalancer, - LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, - LoadBalancerProfile = new ManagedClusterLoadBalancerProfile() - { - ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - Count = 2, - }, - }, - IPFamilies = -{ -IPFamily.IPv4,IPFamily.IPv6 -}, - }, - AutoScalerProfile = new ManagedClusterAutoScalerProfile() - { - BalanceSimilarNodeGroups = "true", - Expander = AutoScaleExpander.Priority, - MaxNodeProvisionTime = "15m", - NewPodScaleUpDelay = "1m", - ScanIntervalInSeconds = "20s", - ScaleDownDelayAfterAdd = "15m", - SkipNodesWithSystemPods = "false", - }, - DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - Tags = -{ -["archv2"] = "", -["tier"] = "production", -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs deleted file mode 100644 index 268529b0778f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs +++ /dev/null @@ -1,665 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServiceManagedClusterResource - { - // List Managed Clusters - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetContainerServiceManagedClusters_ListManagedClusters() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList.json - // this example is just showing the usage of "ManagedClusters_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (ContainerServiceManagedClusterResource item in subscriptionResource.GetContainerServiceManagedClustersAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Get Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAccessProfile_GetManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGetAccessProfile.json - // this example is just showing the usage of "ManagedClusters_GetAccessProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - string roleName = "clusterUser"; - ManagedClusterAccessProfile result = await containerServiceManagedCluster.GetAccessProfileAsync(roleName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetClusterAdminCredentials_GetManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterAdminCredentials.json - // this example is just showing the usage of "ManagedClusters_ListClusterAdminCredentials" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - ManagedClusterCredentials result = await containerServiceManagedCluster.GetClusterAdminCredentialsAsync(); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetClusterUserCredentials_GetManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterUserCredentials.json - // this example is just showing the usage of "ManagedClusters_ListClusterUserCredentials" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - ManagedClusterCredentials result = await containerServiceManagedCluster.GetClusterUserCredentialsAsync(); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetClusterMonitoringUserCredentials_GetManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json - // this example is just showing the usage of "ManagedClusters_ListClusterMonitoringUserCredentials" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - ManagedClusterCredentials result = await containerServiceManagedCluster.GetClusterMonitoringUserCredentialsAsync(); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json - // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - ContainerServiceManagedClusterResource result = await containerServiceManagedCluster.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Update Managed Cluster Tags - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdateManagedClusterTags() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersUpdateTags.json - // this example is just showing the usage of "ManagedClusters_UpdateTags" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - ContainerServiceTagsObject containerServiceTagsObject = new ContainerServiceTagsObject() - { - Tags = -{ -["archv3"] = "", -["tier"] = "testing", -}, - }; - ArmOperation lro = await containerServiceManagedCluster.UpdateAsync(WaitUntil.Completed, containerServiceTagsObject); - ContainerServiceManagedClusterResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceManagedClusterData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Delete Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersDelete.json - // this example is just showing the usage of "ManagedClusters_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - await containerServiceManagedCluster.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Reset Service Principal Profile - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task ResetServicePrincipalProfile_ResetServicePrincipalProfile() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersResetServicePrincipalProfile.json - // this example is just showing the usage of "ManagedClusters_ResetServicePrincipalProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile = new ManagedClusterServicePrincipalProfile("clientid") - { - Secret = "secret", - }; - await containerServiceManagedCluster.ResetServicePrincipalProfileAsync(WaitUntil.Completed, managedClusterServicePrincipalProfile); - - Console.WriteLine($"Succeeded"); - } - - // Reset AAD Profile - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task ResetAadProfile_ResetAADProfile() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersResetAADProfile.json - // this example is just showing the usage of "ManagedClusters_ResetAadProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - ManagedClusterAadProfile managedClusterAadProfile = new ManagedClusterAadProfile() - { - ClientAppId = Guid.Parse("clientappid"), - ServerAppId = Guid.Parse("serverappid"), - ServerAppSecret = "serverappsecret", - TenantId = Guid.Parse("tenantid"), - }; - await containerServiceManagedCluster.ResetAadProfileAsync(WaitUntil.Completed, managedClusterAadProfile); - - Console.WriteLine($"Succeeded"); - } - - // Rotate Cluster Certificates - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task RotateClusterCertificates_RotateClusterCertificates() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersRotateClusterCertificates.json - // this example is just showing the usage of "ManagedClusters_RotateClusterCertificates" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - await containerServiceManagedCluster.RotateClusterCertificatesAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Abort operation on managed cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task AbortLatestOperation_AbortOperationOnManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersAbortOperation.json - // this example is just showing the usage of "ManagedClusters_AbortLatestOperation" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - await containerServiceManagedCluster.AbortLatestOperationAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Rotate Cluster Service Account Signing Keys - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task RotateServiceAccountSigningKeys_RotateClusterServiceAccountSigningKeys() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json - // this example is just showing the usage of "ManagedClusters_RotateServiceAccountSigningKeys" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - await containerServiceManagedCluster.RotateServiceAccountSigningKeysAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Stop Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Stop_StopManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersStop.json - // this example is just showing the usage of "ManagedClusters_Stop" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - await containerServiceManagedCluster.StopAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Start Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Start_StartManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersStart.json - // this example is just showing the usage of "ManagedClusters_Start" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - await containerServiceManagedCluster.StartAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // submitNewCommand - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task RunCommand_SubmitNewCommand() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandRequest.json - // this example is just showing the usage of "ManagedClusters_RunCommand" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - ManagedClusterRunCommandContent content = new ManagedClusterRunCommandContent("kubectl apply -f ns.yaml") - { - Context = "", - ClusterToken = "", - }; - ArmOperation lro = await containerServiceManagedCluster.RunCommandAsync(WaitUntil.Completed, content); - ManagedClusterRunCommandResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // commandFailedResult - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCommandResult_CommandFailedResult() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandResultFailed.json - // this example is just showing the usage of "ManagedClusters_GetCommandResult" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - string commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; - ManagedClusterRunCommandResult result = await containerServiceManagedCluster.GetCommandResultAsync(commandId); - - Console.WriteLine($"Succeeded: {result}"); - } - - // commandSucceedResult - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCommandResult_CommandSucceedResult() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandResultSucceed.json - // this example is just showing the usage of "ManagedClusters_GetCommandResult" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - string commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; - ManagedClusterRunCommandResult result = await containerServiceManagedCluster.GetCommandResultAsync(commandId); - - Console.WriteLine($"Succeeded: {result}"); - } - - // List OutboundNetworkDependenciesEndpoints by Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDependenciesEndpointsByManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/OutboundNetworkDependenciesEndpointsList.json - // this example is just showing the usage of "ManagedClusters_ListOutboundNetworkDependenciesEndpoints" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation and iterate over the result - await foreach (ContainerServiceOutboundEnvironmentEndpoint item in containerServiceManagedCluster.GetOutboundNetworkDependenciesEndpointsAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Get available versions for agent pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAvailableAgentPoolVersions_GetAvailableVersionsForAgentPool() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json - // this example is just showing the usage of "AgentPools_GetAvailableAgentPoolVersions" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - AgentPoolAvailableVersions result = await containerServiceManagedCluster.GetAvailableAgentPoolVersionsAsync(); - - Console.WriteLine($"Succeeded: {result}"); - } - - // List Private Link Resources by Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetPrivateLinkResources_ListPrivateLinkResourcesByManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateLinkResourcesList.json - // this example is just showing the usage of "PrivateLinkResources_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation and iterate over the result - await foreach (ContainerServicePrivateLinkResourceData item in containerServiceManagedCluster.GetPrivateLinkResourcesAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Resolve the Private Link Service ID for Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task ResolvePrivateLinkServiceId_ResolveThePrivateLinkServiceIDForManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ResolvePrivateLinkServiceId.json - // this example is just showing the usage of "ResolvePrivateLinkServiceId_Post" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // invoke the operation - ContainerServicePrivateLinkResourceData data = new ContainerServicePrivateLinkResourceData() - { - Name = "management", - }; - ContainerServicePrivateLinkResourceData result = await containerServiceManagedCluster.ResolvePrivateLinkServiceIdAsync(data); - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs deleted file mode 100644 index 253453010288..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServicePrivateEndpointConnectionCollection - { - // List Private Endpoint Connections by Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListPrivateEndpointConnectionsByManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsList.json - // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServicePrivateEndpointConnectionResource - ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections(); - - // invoke the operation and iterate over the result - await foreach (ContainerServicePrivateEndpointConnectionResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServicePrivateEndpointConnectionData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Get Private Endpoint Connection - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetPrivateEndpointConnection() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServicePrivateEndpointConnectionResource - ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections(); - - // invoke the operation - string privateEndpointConnectionName = "privateendpointconnection1"; - ContainerServicePrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServicePrivateEndpointConnectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get Private Endpoint Connection - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetPrivateEndpointConnection() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServicePrivateEndpointConnectionResource - ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections(); - - // invoke the operation - string privateEndpointConnectionName = "privateendpointconnection1"; - bool result = await collection.ExistsAsync(privateEndpointConnectionName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Private Endpoint Connection - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetPrivateEndpointConnection() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServicePrivateEndpointConnectionResource - ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections(); - - // invoke the operation - string privateEndpointConnectionName = "privateendpointconnection1"; - NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName); - ContainerServicePrivateEndpointConnectionResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServicePrivateEndpointConnectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // Update Private Endpoint Connection - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_UpdatePrivateEndpointConnection() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsUpdate.json - // this example is just showing the usage of "PrivateEndpointConnections_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServicePrivateEndpointConnectionResource - ContainerServicePrivateEndpointConnectionCollection collection = containerServiceManagedCluster.GetContainerServicePrivateEndpointConnections(); - - // invoke the operation - string privateEndpointConnectionName = "privateendpointconnection1"; - ContainerServicePrivateEndpointConnectionData data = new ContainerServicePrivateEndpointConnectionData() - { - ConnectionState = new ContainerServicePrivateLinkServiceConnectionState() - { - Status = ContainerServicePrivateLinkServiceConnectionStatus.Approved, - }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); - ContainerServicePrivateEndpointConnectionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServicePrivateEndpointConnectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs deleted file mode 100644 index 89fceb7048f1..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServicePrivateEndpointConnectionResource - { - // Get Private Endpoint Connection - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetPrivateEndpointConnection() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServicePrivateEndpointConnectionResource created on azure - // for more information of creating ContainerServicePrivateEndpointConnectionResource, please refer to the document of ContainerServicePrivateEndpointConnectionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string privateEndpointConnectionName = "privateendpointconnection1"; - ResourceIdentifier containerServicePrivateEndpointConnectionResourceId = ContainerServicePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - ContainerServicePrivateEndpointConnectionResource containerServicePrivateEndpointConnection = client.GetContainerServicePrivateEndpointConnectionResource(containerServicePrivateEndpointConnectionResourceId); - - // invoke the operation - ContainerServicePrivateEndpointConnectionResource result = await containerServicePrivateEndpointConnection.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServicePrivateEndpointConnectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Update Private Endpoint Connection - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdatePrivateEndpointConnection() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsUpdate.json - // this example is just showing the usage of "PrivateEndpointConnections_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServicePrivateEndpointConnectionResource created on azure - // for more information of creating ContainerServicePrivateEndpointConnectionResource, please refer to the document of ContainerServicePrivateEndpointConnectionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string privateEndpointConnectionName = "privateendpointconnection1"; - ResourceIdentifier containerServicePrivateEndpointConnectionResourceId = ContainerServicePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - ContainerServicePrivateEndpointConnectionResource containerServicePrivateEndpointConnection = client.GetContainerServicePrivateEndpointConnectionResource(containerServicePrivateEndpointConnectionResourceId); - - // invoke the operation - ContainerServicePrivateEndpointConnectionData data = new ContainerServicePrivateEndpointConnectionData() - { - ConnectionState = new ContainerServicePrivateLinkServiceConnectionState() - { - Status = ContainerServicePrivateLinkServiceConnectionStatus.Approved, - }, - }; - ArmOperation lro = await containerServicePrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); - ContainerServicePrivateEndpointConnectionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServicePrivateEndpointConnectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Delete Private Endpoint Connection - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeletePrivateEndpointConnection() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsDelete.json - // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServicePrivateEndpointConnectionResource created on azure - // for more information of creating ContainerServicePrivateEndpointConnectionResource, please refer to the document of ContainerServicePrivateEndpointConnectionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string privateEndpointConnectionName = "privateendpointconnection1"; - ResourceIdentifier containerServicePrivateEndpointConnectionResourceId = ContainerServicePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - ContainerServicePrivateEndpointConnectionResource containerServicePrivateEndpointConnection = client.GetContainerServicePrivateEndpointConnectionResource(containerServicePrivateEndpointConnectionResourceId); - - // invoke the operation - await containerServicePrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs deleted file mode 100644 index bc47c1281cb0..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServiceTrustedAccessRoleBindingCollection - { - // List trusted access role bindings - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListTrustedAccessRoleBindings() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_List.json - // this example is just showing the usage of "TrustedAccessRoleBindings_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceTrustedAccessRoleBindingResource - ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings(); - - // invoke the operation and iterate over the result - await foreach (ContainerServiceTrustedAccessRoleBindingResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceTrustedAccessRoleBindingData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Get a trusted access role binding - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetATrustedAccessRoleBinding() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json - // this example is just showing the usage of "TrustedAccessRoleBindings_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceTrustedAccessRoleBindingResource - ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings(); - - // invoke the operation - string trustedAccessRoleBindingName = "binding1"; - ContainerServiceTrustedAccessRoleBindingResource result = await collection.GetAsync(trustedAccessRoleBindingName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceTrustedAccessRoleBindingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get a trusted access role binding - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetATrustedAccessRoleBinding() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json - // this example is just showing the usage of "TrustedAccessRoleBindings_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceTrustedAccessRoleBindingResource - ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings(); - - // invoke the operation - string trustedAccessRoleBindingName = "binding1"; - bool result = await collection.ExistsAsync(trustedAccessRoleBindingName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get a trusted access role binding - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetATrustedAccessRoleBinding() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json - // this example is just showing the usage of "TrustedAccessRoleBindings_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceTrustedAccessRoleBindingResource - ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings(); - - // invoke the operation - string trustedAccessRoleBindingName = "binding1"; - NullableResponse response = await collection.GetIfExistsAsync(trustedAccessRoleBindingName); - ContainerServiceTrustedAccessRoleBindingResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceTrustedAccessRoleBindingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // Create or update a trusted access role binding - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateOrUpdateATrustedAccessRoleBinding() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json - // this example is just showing the usage of "TrustedAccessRoleBindings_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this ContainerServiceTrustedAccessRoleBindingResource - ContainerServiceTrustedAccessRoleBindingCollection collection = containerServiceManagedCluster.GetContainerServiceTrustedAccessRoleBindings(); - - // invoke the operation - string trustedAccessRoleBindingName = "binding1"; - ContainerServiceTrustedAccessRoleBindingData data = new ContainerServiceTrustedAccessRoleBindingData(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c"), new string[] - { -"Microsoft.MachineLearningServices/workspaces/reader","Microsoft.MachineLearningServices/workspaces/writer" - }); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, trustedAccessRoleBindingName, data); - ContainerServiceTrustedAccessRoleBindingResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceTrustedAccessRoleBindingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs deleted file mode 100644 index 71e7ffd14015..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ContainerServiceTrustedAccessRoleBindingResource - { - // Get a trusted access role binding - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetATrustedAccessRoleBinding() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json - // this example is just showing the usage of "TrustedAccessRoleBindings_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceTrustedAccessRoleBindingResource created on azure - // for more information of creating ContainerServiceTrustedAccessRoleBindingResource, please refer to the document of ContainerServiceTrustedAccessRoleBindingResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string trustedAccessRoleBindingName = "binding1"; - ResourceIdentifier containerServiceTrustedAccessRoleBindingResourceId = ContainerServiceTrustedAccessRoleBindingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); - ContainerServiceTrustedAccessRoleBindingResource containerServiceTrustedAccessRoleBinding = client.GetContainerServiceTrustedAccessRoleBindingResource(containerServiceTrustedAccessRoleBindingResourceId); - - // invoke the operation - ContainerServiceTrustedAccessRoleBindingResource result = await containerServiceTrustedAccessRoleBinding.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceTrustedAccessRoleBindingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Create or update a trusted access role binding - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateOrUpdateATrustedAccessRoleBinding() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json - // this example is just showing the usage of "TrustedAccessRoleBindings_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceTrustedAccessRoleBindingResource created on azure - // for more information of creating ContainerServiceTrustedAccessRoleBindingResource, please refer to the document of ContainerServiceTrustedAccessRoleBindingResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string trustedAccessRoleBindingName = "binding1"; - ResourceIdentifier containerServiceTrustedAccessRoleBindingResourceId = ContainerServiceTrustedAccessRoleBindingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); - ContainerServiceTrustedAccessRoleBindingResource containerServiceTrustedAccessRoleBinding = client.GetContainerServiceTrustedAccessRoleBindingResource(containerServiceTrustedAccessRoleBindingResourceId); - - // invoke the operation - ContainerServiceTrustedAccessRoleBindingData data = new ContainerServiceTrustedAccessRoleBindingData(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c"), new string[] - { -"Microsoft.MachineLearningServices/workspaces/reader","Microsoft.MachineLearningServices/workspaces/writer" - }); - ArmOperation lro = await containerServiceTrustedAccessRoleBinding.UpdateAsync(WaitUntil.Completed, data); - ContainerServiceTrustedAccessRoleBindingResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ContainerServiceTrustedAccessRoleBindingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Delete a trusted access role binding - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteATrustedAccessRoleBinding() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Delete.json - // this example is just showing the usage of "TrustedAccessRoleBindings_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceTrustedAccessRoleBindingResource created on azure - // for more information of creating ContainerServiceTrustedAccessRoleBindingResource, please refer to the document of ContainerServiceTrustedAccessRoleBindingResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string trustedAccessRoleBindingName = "binding1"; - ResourceIdentifier containerServiceTrustedAccessRoleBindingResourceId = ContainerServiceTrustedAccessRoleBindingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); - ContainerServiceTrustedAccessRoleBindingResource containerServiceTrustedAccessRoleBinding = client.GetContainerServiceTrustedAccessRoleBindingResource(containerServiceTrustedAccessRoleBindingResourceId); - - // invoke the operation - await containerServiceTrustedAccessRoleBinding.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetCollection.cs similarity index 62% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetCollection.cs index 63175e8ef93c..475f719228db 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetCollection.cs @@ -9,19 +9,20 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ContainerService.Samples { - public partial class Sample_AgentPoolSnapshotCollection + public partial class Sample_FleetCollection { - // List Snapshots by Resource Group + // Lists the Fleet resources in a resource group. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListSnapshotsByResourceGroup() + public async Task GetAll_ListsTheFleetResourcesInAResourceGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsListByResourceGroup.json - // this example is just showing the usage of "Snapshots_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_ListByResourceGroup.json + // this example is just showing the usage of "Fleets_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -30,20 +31,20 @@ public async Task GetAll_ListSnapshotsByResourceGroup() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid1"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this AgentPoolSnapshotResource - AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots(); + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); // invoke the operation and iterate over the result - await foreach (AgentPoolSnapshotResource item in collection.GetAllAsync()) + await foreach (FleetResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - AgentPoolSnapshotData resourceData = item.Data; + FleetData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -51,13 +52,13 @@ public async Task GetAll_ListSnapshotsByResourceGroup() Console.WriteLine($"Succeeded"); } - // Get Snapshot + // Gets a Fleet resource. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetSnapshot() + public async Task Get_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json - // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -66,32 +67,32 @@ public async Task Get_GetSnapshot() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid1"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this AgentPoolSnapshotResource - AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots(); + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); // invoke the operation - string resourceName = "snapshot1"; - AgentPoolSnapshotResource result = await collection.GetAsync(resourceName); + string fleetName = "fleet1"; + FleetResource result = await collection.GetAsync(fleetName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - AgentPoolSnapshotData resourceData = result.Data; + FleetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Get Snapshot + // Gets a Fleet resource. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetSnapshot() + public async Task Exists_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json - // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -100,28 +101,28 @@ public async Task Exists_GetSnapshot() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid1"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this AgentPoolSnapshotResource - AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots(); + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); // invoke the operation - string resourceName = "snapshot1"; - bool result = await collection.ExistsAsync(resourceName); + string fleetName = "fleet1"; + bool result = await collection.ExistsAsync(fleetName); Console.WriteLine($"Succeeded: {result}"); } - // Get Snapshot + // Gets a Fleet resource. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetSnapshot() + public async Task GetIfExists_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json - // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -130,18 +131,18 @@ public async Task GetIfExists_GetSnapshot() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid1"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this AgentPoolSnapshotResource - AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots(); + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); // invoke the operation - string resourceName = "snapshot1"; - NullableResponse response = await collection.GetIfExistsAsync(resourceName); - AgentPoolSnapshotResource result = response.HasValue ? response.Value : null; + string fleetName = "fleet1"; + NullableResponse response = await collection.GetIfExistsAsync(fleetName); + FleetResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -151,19 +152,19 @@ public async Task GetIfExists_GetSnapshot() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - AgentPoolSnapshotData resourceData = result.Data; + FleetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } } - // Create/Update Snapshot + // Creates a Fleet resource with a long running operation. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateUpdateSnapshot() + public async Task CreateOrUpdate_CreatesAFleetResourceWithALongRunningOperation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsCreate.json - // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_CreateOrUpdate.json + // this example is just showing the usage of "Fleets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -172,31 +173,38 @@ public async Task CreateOrUpdate_CreateUpdateSnapshot() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid1"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this AgentPoolSnapshotResource - AgentPoolSnapshotCollection collection = resourceGroupResource.GetAgentPoolSnapshots(); + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); // invoke the operation - string resourceName = "snapshot1"; - AgentPoolSnapshotData data = new AgentPoolSnapshotData(new AzureLocation("westus")) + string fleetName = "fleet1"; + FleetData data = new FleetData(new AzureLocation("East US")) { - CreationDataSourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0"), + HubProfile = new FleetHubProfile() + { + DnsPrefix = "dnsprefix1", + AgentProfile = new AgentProfile() + { + VmSize = "Standard_DS1", + }, + }, Tags = { -["key1"] = "val1", -["key2"] = "val2", +["archv2"] = "", +["tier"] = "production", }, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); - AgentPoolSnapshotResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetName, data); + FleetResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - AgentPoolSnapshotData resourceData = result.Data; + FleetData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberCollection.cs new file mode 100644 index 000000000000..55d1268f0cce --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberCollection.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_FleetMemberCollection + { + // Lists the members of a Fleet. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListsTheMembersOfAFleet() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/FleetMembers_ListByFleet.json + // this example is just showing the usage of "FleetMembers_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation and iterate over the result + await foreach (FleetMemberResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Gets a FleetMember resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsAFleetMemberResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/FleetMembers_Get.json + // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "member-1"; + FleetMemberResource result = await collection.GetAsync(fleetMemberName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Gets a FleetMember resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetsAFleetMemberResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/FleetMembers_Get.json + // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "member-1"; + bool result = await collection.ExistsAsync(fleetMemberName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Gets a FleetMember resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetsAFleetMemberResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/FleetMembers_Get.json + // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "member-1"; + NullableResponse response = await collection.GetIfExistsAsync(fleetMemberName); + FleetMemberResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Creates a FleetMember resource with a long running operation. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreatesAFleetMemberResourceWithALongRunningOperation() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/FleetMembers_Create.json + // this example is just showing the usage of "FleetMembers_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetMemberResource + FleetMemberCollection collection = fleet.GetFleetMembers(); + + // invoke the operation + string fleetMemberName = "member-1"; + FleetMemberData data = new FleetMemberData() + { + ClusterResourceId = new ResourceIdentifier("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster-1"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetMemberName, data); + FleetMemberResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberResource.cs new file mode 100644 index 000000000000..ba45df11dcdd --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetMemberResource.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_FleetMemberResource + { + // Gets a FleetMember resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsAFleetMemberResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/FleetMembers_Get.json + // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetMemberResource created on azure + // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetMemberName = "member-1"; + ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId); + + // invoke the operation + FleetMemberResource result = await fleetMember.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Updates a FleetMember resource synchronously. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdatesAFleetMemberResourceSynchronously() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/FleetMembers_Update.json + // this example is just showing the usage of "FleetMembers_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetMemberResource created on azure + // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetMemberName = "member-1"; + ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId); + + // invoke the operation + FleetMemberPatch patch = new FleetMemberPatch() + { + Group = "staging", + }; + ArmOperation lro = await fleetMember.UpdateAsync(WaitUntil.Completed, patch); + FleetMemberResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetMemberData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Deletes a FleetMember resource asynchronously with a long running operation. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeletesAFleetMemberResourceAsynchronouslyWithALongRunningOperation() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/FleetMembers_Delete.json + // this example is just showing the usage of "FleetMembers_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetMemberResource created on azure + // for more information of creating FleetMemberResource, please refer to the document of FleetMemberResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetMemberName = "member-1"; + ResourceIdentifier fleetMemberResourceId = FleetMemberResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + FleetMemberResource fleetMember = client.GetFleetMemberResource(fleetMemberResourceId); + + // invoke the operation + await fleetMember.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetResource.cs new file mode 100644 index 000000000000..8510c5e17cd8 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetResource.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_FleetResource + { + // Lists the Fleet resources in a subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetFleets_ListsTheFleetResourcesInASubscription() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_ListBySub.json + // this example is just showing the usage of "Fleets_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "subid1"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in subscriptionResource.GetFleetsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Gets a Fleet resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsAFleetResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetResource result = await fleet.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update a Fleet. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateAFleet() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_PatchTags.json + // this example is just showing the usage of "Fleets_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetPatch patch = new FleetPatch() + { + Tags = +{ +["env"] = "prod", +["tier"] = "secure", +}, + }; + string ifMatch = "dfjkwelr7384"; + ArmOperation lro = await fleet.UpdateAsync(WaitUntil.Completed, patch, ifMatch: ifMatch); + FleetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Deletes a Fleet resource asynchronously with a long running operation. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeletesAFleetResourceAsynchronouslyWithALongRunningOperation() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_Delete.json + // this example is just showing the usage of "Fleets_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + await fleet.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Lists the user credentials of a Fleet. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetCredentials_ListsTheUserCredentialsOfAFleet() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/Fleets_ListCredentialsResult.json + // this example is just showing the usage of "Fleets_ListCredentials" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetCredentialResults result = await fleet.GetCredentialsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs new file mode 100644 index 000000000000..c564be1b75a3 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_FleetUpdateStrategyCollection + { + // List the FleetUpdateStrategy resources by fleet. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListTheFleetUpdateStrategyResourcesByFleet() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateStrategies_ListByFleet.json + // this example is just showing the usage of "FleetUpdateStrategies_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation and iterate over the result + await foreach (FleetUpdateStrategyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strategy1"; + FleetUpdateStrategyResource result = await collection.GetAsync(updateStrategyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strategy1"; + bool result = await collection.ExistsAsync(updateStrategyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strategy1"; + NullableResponse response = await collection.GetIfExistsAsync(updateStrategyName); + FleetUpdateStrategyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create a FleetUpdateStrategy. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAFleetUpdateStrategy() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateStrategies_CreateOrUpdate.json + // this example is just showing the usage of "FleetUpdateStrategies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetUpdateStrategyResource + FleetUpdateStrategyCollection collection = fleet.GetFleetUpdateStrategies(); + + // invoke the operation + string updateStrategyName = "strartegy1"; + FleetUpdateStrategyData data = new FleetUpdateStrategyData() + { + StrategyStages = +{ +new UpdateStage("stage1") +{ +Groups = +{ +new UpdateGroup("group-a") +}, +AfterStageWaitInSeconds = 3600, +} +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, updateStrategyName, data); + FleetUpdateStrategyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs new file mode 100644 index 000000000000..7f934bc9ed4e --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_FleetUpdateStrategyResource + { + // Get a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateStrategies_Get.json + // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateStrategyName = "strategy1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + FleetUpdateStrategyResource result = await fleetUpdateStrategy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a FleetUpdateStrategy. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateAFleetUpdateStrategy() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateStrategies_CreateOrUpdate.json + // this example is just showing the usage of "FleetUpdateStrategies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateStrategyName = "strartegy1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + FleetUpdateStrategyData data = new FleetUpdateStrategyData() + { + StrategyStages = +{ +new UpdateStage("stage1") +{ +Groups = +{ +new UpdateGroup("group-a") +}, +AfterStageWaitInSeconds = 3600, +} +}, + }; + ArmOperation lro = await fleetUpdateStrategy.UpdateAsync(WaitUntil.Completed, data); + FleetUpdateStrategyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetUpdateStrategyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete a FleetUpdateStrategy resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAFleetUpdateStrategyResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateStrategies_Delete.json + // this example is just showing the usage of "FleetUpdateStrategies_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetUpdateStrategyResource created on azure + // for more information of creating FleetUpdateStrategyResource, please refer to the document of FleetUpdateStrategyResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateStrategyName = "strategy1"; + ResourceIdentifier fleetUpdateStrategyResourceId = FleetUpdateStrategyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateStrategyName); + FleetUpdateStrategyResource fleetUpdateStrategy = client.GetFleetUpdateStrategyResource(fleetUpdateStrategyResourceId); + + // invoke the operation + await fleetUpdateStrategy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs deleted file mode 100644 index f47c234140f9..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_ManagedClusterUpgradeProfileResource - { - // Get Upgrade Profile for Managed Cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetUpgradeProfileForManagedCluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGetUpgradeProfile.json - // this example is just showing the usage of "ManagedClusters_GetUpgradeProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ManagedClusterUpgradeProfileResource created on azure - // for more information of creating ManagedClusterUpgradeProfileResource, please refer to the document of ManagedClusterUpgradeProfileResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier managedClusterUpgradeProfileResourceId = ManagedClusterUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ManagedClusterUpgradeProfileResource managedClusterUpgradeProfile = client.GetManagedClusterUpgradeProfileResource(managedClusterUpgradeProfileResourceId); - - // invoke the operation - ManagedClusterUpgradeProfileResource result = await managedClusterUpgradeProfile.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ManagedClusterUpgradeProfileData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs deleted file mode 100644 index 884bd8df18bb..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_MeshRevisionProfileCollection - { - // List mesh revision profiles in a location - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListMeshRevisionProfilesInALocation() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList_MeshRevisionProfiles.json - // this example is just showing the usage of "ManagedClusters_ListMeshRevisionProfiles" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this MeshRevisionProfileResource - AzureLocation location = new AzureLocation("location1"); - MeshRevisionProfileCollection collection = subscriptionResource.GetMeshRevisionProfiles(location); - - // invoke the operation and iterate over the result - await foreach (MeshRevisionProfileResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MeshRevisionProfileData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Get a mesh revision profile for a mesh mode - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetAMeshRevisionProfileForAMeshMode() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json - // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this MeshRevisionProfileResource - AzureLocation location = new AzureLocation("location1"); - MeshRevisionProfileCollection collection = subscriptionResource.GetMeshRevisionProfiles(location); - - // invoke the operation - string mode = "istio"; - MeshRevisionProfileResource result = await collection.GetAsync(mode); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MeshRevisionProfileData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get a mesh revision profile for a mesh mode - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetAMeshRevisionProfileForAMeshMode() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json - // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this MeshRevisionProfileResource - AzureLocation location = new AzureLocation("location1"); - MeshRevisionProfileCollection collection = subscriptionResource.GetMeshRevisionProfiles(location); - - // invoke the operation - string mode = "istio"; - bool result = await collection.ExistsAsync(mode); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get a mesh revision profile for a mesh mode - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetAMeshRevisionProfileForAMeshMode() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json - // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this MeshRevisionProfileResource - AzureLocation location = new AzureLocation("location1"); - MeshRevisionProfileCollection collection = subscriptionResource.GetMeshRevisionProfiles(location); - - // invoke the operation - string mode = "istio"; - NullableResponse response = await collection.GetIfExistsAsync(mode); - MeshRevisionProfileResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MeshRevisionProfileData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs deleted file mode 100644 index 1f93aa28ed71..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_MeshRevisionProfileResource - { - // Get a mesh revision profile for a mesh mode - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetAMeshRevisionProfileForAMeshMode() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json - // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MeshRevisionProfileResource created on azure - // for more information of creating MeshRevisionProfileResource, please refer to the document of MeshRevisionProfileResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - AzureLocation location = new AzureLocation("location1"); - string mode = "istio"; - ResourceIdentifier meshRevisionProfileResourceId = MeshRevisionProfileResource.CreateResourceIdentifier(subscriptionId, location, mode); - MeshRevisionProfileResource meshRevisionProfile = client.GetMeshRevisionProfileResource(meshRevisionProfileResourceId); - - // invoke the operation - MeshRevisionProfileResource result = await meshRevisionProfile.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MeshRevisionProfileData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs deleted file mode 100644 index 3cfc385c081e..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_MeshUpgradeProfileCollection - { - // Lists version compatibility and upgrade profile for all service meshes in a cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListsVersionCompatibilityAndUpgradeProfileForAllServiceMeshesInACluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList_MeshUpgradeProfiles.json - // this example is just showing the usage of "ManagedClusters_ListMeshUpgradeProfiles" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this MeshUpgradeProfileResource - MeshUpgradeProfileCollection collection = containerServiceManagedCluster.GetMeshUpgradeProfiles(); - - // invoke the operation and iterate over the result - await foreach (MeshUpgradeProfileResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MeshUpgradeProfileData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Gets version compatibility and upgrade profile for a service mesh in a cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json - // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this MeshUpgradeProfileResource - MeshUpgradeProfileCollection collection = containerServiceManagedCluster.GetMeshUpgradeProfiles(); - - // invoke the operation - string mode = "istio"; - MeshUpgradeProfileResource result = await collection.GetAsync(mode); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MeshUpgradeProfileData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Gets version compatibility and upgrade profile for a service mesh in a cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json - // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this MeshUpgradeProfileResource - MeshUpgradeProfileCollection collection = containerServiceManagedCluster.GetMeshUpgradeProfiles(); - - // invoke the operation - string mode = "istio"; - bool result = await collection.ExistsAsync(mode); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Gets version compatibility and upgrade profile for a service mesh in a cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json - // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ContainerServiceManagedClusterResource created on azure - // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); - - // get the collection of this MeshUpgradeProfileResource - MeshUpgradeProfileCollection collection = containerServiceManagedCluster.GetMeshUpgradeProfiles(); - - // invoke the operation - string mode = "istio"; - NullableResponse response = await collection.GetIfExistsAsync(mode); - MeshUpgradeProfileResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MeshUpgradeProfileData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs deleted file mode 100644 index 9d5fb16420aa..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_MeshUpgradeProfileResource - { - // Gets version compatibility and upgrade profile for a service mesh in a cluster - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json - // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MeshUpgradeProfileResource created on azure - // for more information of creating MeshUpgradeProfileResource, please refer to the document of MeshUpgradeProfileResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string resourceName = "clustername1"; - string mode = "istio"; - ResourceIdentifier meshUpgradeProfileResourceId = MeshUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, mode); - MeshUpgradeProfileResource meshUpgradeProfile = client.GetMeshUpgradeProfileResource(meshUpgradeProfileResourceId); - - // invoke the operation - MeshUpgradeProfileResource result = await meshUpgradeProfile.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MeshUpgradeProfileData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_OSOptionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_OSOptionProfileResource.cs deleted file mode 100644 index d523ebe5480a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_OSOptionProfileResource.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_OSOptionProfileResource - { - // Get Container Service OS Options - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetContainerServiceOSOptions() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ContainerServiceGetOSOptions.json - // this example is just showing the usage of "ManagedClusters_GetOSOptions" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this OSOptionProfileResource created on azure - // for more information of creating OSOptionProfileResource, please refer to the document of OSOptionProfileResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - AzureLocation location = new AzureLocation("location1"); - ResourceIdentifier osOptionProfileResourceId = OSOptionProfileResource.CreateResourceIdentifier(subscriptionId, location); - OSOptionProfileResource osOptionProfile = client.GetOSOptionProfileResource(osOptionProfileResourceId); - - // invoke the operation - OSOptionProfileResource result = await osOptionProfile.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - OSOptionProfileData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs deleted file mode 100644 index 4ffce8b10134..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService.Samples -{ - public partial class Sample_SubscriptionResourceExtensions - { - // List Kubernetes Versions - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetKubernetesVersionsManagedCluster_ListKubernetesVersions() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/KubernetesVersions_List.json - // this example is just showing the usage of "ManagedClusters_ListKubernetesVersions" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation - AzureLocation location = new AzureLocation("location1"); - KubernetesVersionListResult result = await subscriptionResource.GetKubernetesVersionsManagedClusterAsync(location); - - Console.WriteLine($"Succeeded: {result}"); - } - - // List trusted access roles - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetTrustedAccessRoles_ListTrustedAccessRoles() - { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoles_List.json - // this example is just showing the usage of "TrustedAccessRoles_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - AzureLocation location = new AzureLocation("westus2"); - await foreach (ContainerServiceTrustedAccessRole item in subscriptionResource.GetTrustedAccessRolesAsync(location)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunCollection.cs new file mode 100644 index 000000000000..51ce8e355136 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunCollection.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_UpdateRunCollection + { + // Lists the UpdateRun resources by fleet. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListsTheUpdateRunResourcesByFleet() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_ListByFleet.json + // this example is just showing the usage of "UpdateRuns_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation and iterate over the result + await foreach (UpdateRunResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Gets an UpdateRun resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsAnUpdateRunResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_Get.json + // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "run1"; + UpdateRunResource result = await collection.GetAsync(updateRunName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Gets an UpdateRun resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetsAnUpdateRunResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_Get.json + // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "run1"; + bool result = await collection.ExistsAsync(updateRunName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Gets an UpdateRun resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetsAnUpdateRunResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_Get.json + // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "run1"; + NullableResponse response = await collection.GetIfExistsAsync(updateRunName); + UpdateRunResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create an UpdateRun. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAnUpdateRun() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_CreateOrUpdate.json + // this example is just showing the usage of "UpdateRuns_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this UpdateRunResource + UpdateRunCollection collection = fleet.GetUpdateRuns(); + + // invoke the operation + string updateRunName = "run1"; + UpdateRunData data = new UpdateRunData() + { + UpdateStrategyId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"), + StrategyStages = +{ +new UpdateStage("stage1") +{ +Groups = +{ +new UpdateGroup("group-a") +}, +AfterStageWaitInSeconds = 3600, +} +}, + ManagedClusterUpdate = new ManagedClusterUpdate(new ManagedClusterUpgradeSpec(ManagedClusterUpgradeType.Full) + { + KubernetesVersion = "1.26.1", + }) + { + SelectionType = NodeImageSelectionType.Latest, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, updateRunName, data); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunResource.cs new file mode 100644 index 000000000000..7f68e86a8f50 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_UpdateRunResource.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_UpdateRunResource + { + // Gets an UpdateRun resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsAnUpdateRunResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_Get.json + // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + UpdateRunResource result = await updateRun.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create an UpdateRun. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateAnUpdateRun() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_CreateOrUpdate.json + // this example is just showing the usage of "UpdateRuns_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + UpdateRunData data = new UpdateRunData() + { + UpdateStrategyId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"), + StrategyStages = +{ +new UpdateStage("stage1") +{ +Groups = +{ +new UpdateGroup("group-a") +}, +AfterStageWaitInSeconds = 3600, +} +}, + ManagedClusterUpdate = new ManagedClusterUpdate(new ManagedClusterUpgradeSpec(ManagedClusterUpgradeType.Full) + { + KubernetesVersion = "1.26.1", + }) + { + SelectionType = NodeImageSelectionType.Latest, + }, + }; + ArmOperation lro = await updateRun.UpdateAsync(WaitUntil.Completed, data); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete an updateRun resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAnUpdateRunResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_Delete.json + // this example is just showing the usage of "UpdateRuns_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + await updateRun.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Skips one or more member/group/stage/afterStageWait(s) of an UpdateRun. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Skip_SkipsOneOrMoreMemberGroupStageAfterStageWaitSOfAnUpdateRun() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_Skip.json + // this example is just showing the usage of "UpdateRuns_Skip" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + SkipProperties body = new SkipProperties(new SkipTarget[] + { +new SkipTarget(TargetType.Member,"member-one"),new SkipTarget(TargetType.AfterStageWait,"stage1") + }); + ArmOperation lro = await updateRun.SkipAsync(WaitUntil.Completed, body); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Starts an UpdateRun. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Start_StartsAnUpdateRun() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_Start.json + // this example is just showing the usage of "UpdateRuns_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + ArmOperation lro = await updateRun.StartAsync(WaitUntil.Completed); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Stops an UpdateRun. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Stop_StopsAnUpdateRun() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2024-04-01/examples/UpdateRuns_Stop.json + // this example is just showing the usage of "UpdateRuns_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UpdateRunResource created on azure + // for more information of creating UpdateRunResource, please refer to the document of UpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier updateRunResourceId = UpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + UpdateRunResource updateRun = client.GetUpdateRunResource(updateRunResourceId); + + // invoke the operation + ArmOperation lro = await updateRun.StopAsync(WaitUntil.Completed); + UpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs deleted file mode 100644 index 327b8b63ae23..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetAgentPoolSnapshots method from an instance of . - /// - public partial class AgentPoolSnapshotCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _agentPoolSnapshotSnapshotsClientDiagnostics; - private readonly SnapshotsRestOperations _agentPoolSnapshotSnapshotsRestClient; - - /// Initializes a new instance of the class for mocking. - protected AgentPoolSnapshotCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal AgentPoolSnapshotCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _agentPoolSnapshotSnapshotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", AgentPoolSnapshotResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(AgentPoolSnapshotResource.ResourceType, out string agentPoolSnapshotSnapshotsApiVersion); - _agentPoolSnapshotSnapshotsRestClient = new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolSnapshotSnapshotsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the managed cluster resource. - /// The snapshot to create or update. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _agentPoolSnapshotSnapshotsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false); - var uri = _agentPoolSnapshotSnapshotsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new AgentPoolSnapshotResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the managed cluster resource. - /// The snapshot to create or update. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _agentPoolSnapshotSnapshotsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken); - var uri = _agentPoolSnapshotSnapshotsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new AgentPoolSnapshotResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Get"); - scope.Start(); - try - { - var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Get"); - scope.Start(); - try - { - var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists snapshots in the specified subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots - /// - /// - /// Operation Id - /// Snapshots_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), _agentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "AgentPoolSnapshotCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists snapshots in the specified subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots - /// - /// - /// Operation Id - /// Snapshots_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _agentPoolSnapshotSnapshotsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), _agentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "AgentPoolSnapshotCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Exists"); - scope.Start(); - try - { - var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.Exists"); - scope.Start(); - try - { - var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotCollection.GetIfExists"); - scope.Start(); - try - { - var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs deleted file mode 100644 index 1bbf5325758a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the AgentPoolSnapshot data model. - /// A node pool snapshot resource. - /// - public partial class AgentPoolSnapshotData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public AgentPoolSnapshotData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// CreationData to be used to specify the source agent pool resource ID to create this snapshot. - /// The type of a snapshot. The default is NodePool. - /// The version of Kubernetes. - /// The version of node image. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The size of the VM. - /// Whether to use a FIPS-enabled OS. - /// Keeps track of any properties unknown to the library. - internal AgentPoolSnapshotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerServiceCreationData creationData, SnapshotType? snapshotType, string kubernetesVersion, string nodeImageVersion, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, string vmSize, bool? enableFips, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - CreationData = creationData; - SnapshotType = snapshotType; - KubernetesVersion = kubernetesVersion; - NodeImageVersion = nodeImageVersion; - OSType = osType; - OSSku = osSku; - VmSize = vmSize; - EnableFips = enableFips; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AgentPoolSnapshotData() - { - } - - /// CreationData to be used to specify the source agent pool resource ID to create this snapshot. - internal ContainerServiceCreationData CreationData { get; set; } - /// This is the ARM ID of the source object to be used to create the target object. - public ResourceIdentifier CreationDataSourceResourceId - { - get => CreationData is null ? default : CreationData.SourceResourceId; - set - { - if (CreationData is null) - CreationData = new ContainerServiceCreationData(); - CreationData.SourceResourceId = value; - } - } - - /// The type of a snapshot. The default is NodePool. - public SnapshotType? SnapshotType { get; set; } - /// The version of Kubernetes. - public string KubernetesVersion { get; } - /// The version of node image. - public string NodeImageVersion { get; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType? OSType { get; } - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - public ContainerServiceOSSku? OSSku { get; } - /// The size of the VM. - public string VmSize { get; } - /// Whether to use a FIPS-enabled OS. - public bool? EnableFips { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.Serialization.cs deleted file mode 100644 index 7e89aba8ec1a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class AgentPoolSnapshotResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - AgentPoolSnapshotData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - AgentPoolSnapshotData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.Serialization.cs deleted file mode 100644 index 419d90b11e1d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.Serialization.cs +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class AgentPoolUpgradeProfileData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfileData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.ToString()); - if (Optional.IsCollectionDefined(Upgrades)) - { - writer.WritePropertyName("upgrades"u8); - writer.WriteStartArray(); - foreach (var item in Upgrades) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(LatestNodeImageVersion)) - { - writer.WritePropertyName("latestNodeImageVersion"u8); - writer.WriteStringValue(LatestNodeImageVersion); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfileData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolUpgradeProfileData(document.RootElement, options); - } - - internal static AgentPoolUpgradeProfileData DeserializeAgentPoolUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - string kubernetesVersion = default; - ContainerServiceOSType osType = default; - IReadOnlyList upgrades = default; - string latestNodeImageVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("osType"u8)) - { - osType = new ContainerServiceOSType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("upgrades"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AgentPoolUpgradeProfilePropertiesUpgradesItem.DeserializeAgentPoolUpgradeProfilePropertiesUpgradesItem(item, options)); - } - upgrades = array; - continue; - } - if (property0.NameEquals("latestNodeImageVersion"u8)) - { - latestNodeImageVersion = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolUpgradeProfileData( - id, - name, - type, - systemData, - kubernetesVersion, - osType, - upgrades ?? new ChangeTrackingList(), - latestNodeImageVersion, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfileData)} does not support writing '{options.Format}' format."); - } - } - - AgentPoolUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolUpgradeProfileData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfileData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs deleted file mode 100644 index 1269f3b9a22f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the AgentPoolUpgradeProfile data model. - /// The list of available upgrades for an agent pool. - /// - public partial class AgentPoolUpgradeProfileData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// The operating system type. The default is Linux. - /// is null. - internal AgentPoolUpgradeProfileData(string kubernetesVersion, ContainerServiceOSType osType) - { - Argument.AssertNotNull(kubernetesVersion, nameof(kubernetesVersion)); - - KubernetesVersion = kubernetesVersion; - OSType = osType; - Upgrades = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The Kubernetes version (major.minor.patch). - /// The operating system type. The default is Linux. - /// List of orchestrator types and versions available for upgrade. - /// The latest AKS supported node image version. - /// Keeps track of any properties unknown to the library. - internal AgentPoolUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string kubernetesVersion, ContainerServiceOSType osType, IReadOnlyList upgrades, string latestNodeImageVersion, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - KubernetesVersion = kubernetesVersion; - OSType = osType; - Upgrades = upgrades; - LatestNodeImageVersion = latestNodeImageVersion; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AgentPoolUpgradeProfileData() - { - } - - /// The Kubernetes version (major.minor.patch). - public string KubernetesVersion { get; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType OSType { get; } - /// List of orchestrator types and versions available for upgrade. - public IReadOnlyList Upgrades { get; } - /// The latest AKS supported node image version. - public string LatestNodeImageVersion { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.Serialization.cs deleted file mode 100644 index 1f850d48dafc..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class AgentPoolUpgradeProfileResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - AgentPoolUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - AgentPoolUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs deleted file mode 100644 index 9c357b37cb3d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing an AgentPoolUpgradeProfile along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetAgentPoolUpgradeProfileResource method. - /// Otherwise you can get one from its parent resource using the GetAgentPoolUpgradeProfile method. - /// - public partial class AgentPoolUpgradeProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - /// The agentPoolName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _agentPoolUpgradeProfileAgentPoolsClientDiagnostics; - private readonly AgentPoolsRestOperations _agentPoolUpgradeProfileAgentPoolsRestClient; - private readonly AgentPoolUpgradeProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/agentPools/upgradeProfiles"; - - /// Initializes a new instance of the class for mocking. - protected AgentPoolUpgradeProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal AgentPoolUpgradeProfileResource(ArmClient client, AgentPoolUpgradeProfileData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal AgentPoolUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _agentPoolUpgradeProfileAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string agentPoolUpgradeProfileAgentPoolsApiVersion); - _agentPoolUpgradeProfileAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolUpgradeProfileAgentPoolsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual AgentPoolUpgradeProfileData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the upgrade profile for an agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default - /// - /// - /// Operation Id - /// AgentPools_GetUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolUpgradeProfileAgentPoolsClientDiagnostics.CreateScope("AgentPoolUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = await _agentPoolUpgradeProfileAgentPoolsRestClient.GetUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the upgrade profile for an agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default - /// - /// - /// Operation Id - /// AgentPools_GetUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolUpgradeProfileAgentPoolsClientDiagnostics.CreateScope("AgentPoolUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = _agentPoolUpgradeProfileAgentPoolsRestClient.GetUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs index d8ce03a6d98a..6f011aad34c4 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs @@ -8,956 +8,259 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Net; using Azure.Core; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.ContainerService.Models { /// Model factory for models. public static partial class ArmContainerServiceModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of OS options. - /// A new instance for mocking. - public static OSOptionProfileData OSOptionProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable osOptionPropertyList = null) - { - osOptionPropertyList ??= new List(); - - return new OSOptionProfileData( - id, - name, - resourceType, - systemData, - osOptionPropertyList?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. - /// A new instance for mocking. - public static ContainerServiceOSOptionProperty ContainerServiceOSOptionProperty(string osType = null, bool enableFipsImage = default) - { - return new ContainerServiceOSOptionProperty(osType, enableFipsImage, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Array of AKS supported Kubernetes versions. - /// A new instance for mocking. - public static KubernetesVersionListResult KubernetesVersionListResult(IEnumerable values = null) - { - values ??= new List(); - - return new KubernetesVersionListResult(values?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// major.minor version of Kubernetes release. - /// Capabilities on this Kubernetes version. - /// Whether this version is in preview mode. - /// Patch versions of Kubernetes release. - /// A new instance for mocking. - public static KubernetesVersion KubernetesVersion(string version = null, IEnumerable capabilitiesSupportPlan = null, bool? isPreview = null, IReadOnlyDictionary patchVersions = null) - { - capabilitiesSupportPlan ??= new List(); - patchVersions ??= new Dictionary(); - - return new KubernetesVersion(version, capabilitiesSupportPlan != null ? new KubernetesVersionCapabilities(capabilitiesSupportPlan?.ToList(), serializedAdditionalRawData: null) : null, isPreview, patchVersions, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Possible upgrade path for given patch version. - /// A new instance for mocking. - public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable upgrades = null) - { - upgrades ??= new List(); - - return new KubernetesPatchVersion(upgrades?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The tags. /// The location. - /// The managed cluster SKU. - /// The extended location of the Virtual Machine. - /// The identity of the managed cluster, if configured. - /// The current provisioning state. - /// The Power State of the cluster. - /// The max number of agent pools for the managed cluster. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. - /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// This cannot be updated once the Managed Cluster has been created. - /// This cannot be updated once the Managed Cluster has been created. - /// The FQDN of the master pool. - /// The FQDN of private cluster. - /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. - /// The agent pool properties. - /// The profile for Linux VMs in the Managed Cluster. - /// The profile for Windows VMs in the Managed Cluster. - /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. - /// The profile of managed cluster add-on. - /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. - /// The OIDC issuer profile of the Managed Cluster. - /// The name of the resource group containing agent pool nodes. - /// Whether to enable Kubernetes Role-Based Access Control. - /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. - /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. - /// The network configuration profile. - /// The Azure Active Directory configuration. - /// The auto upgrade configuration. - /// Settings for upgrading a cluster. - /// Parameters to be applied to the cluster-autoscaler when enabled. - /// The access profile for managed cluster API server. - /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - /// Identities associated with the cluster. - /// Private link resources associated with the cluster. - /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). - /// Configurations for provisioning the cluster with HTTP proxy servers. - /// Security profile for the managed cluster. - /// Storage profile for the managed cluster. - /// Allow or deny public network access for AKS. - /// Workload Auto-scaler profile for the managed cluster. - /// Azure Monitor addon profiles for monitoring the managed cluster. - /// Service mesh profile for a managed cluster. - /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). - /// A new instance for mocking. - public static ContainerServiceManagedClusterData ContainerServiceManagedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedClusterSku sku = null, ExtendedLocation extendedLocation = null, ManagedClusterIdentity clusterIdentity = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, int? maxAgentPools = null, string kubernetesVersion = null, string currentKubernetesVersion = null, string dnsPrefix = null, string fqdnSubdomain = null, string fqdn = null, string privateFqdn = null, string azurePortalFqdn = null, IEnumerable agentPoolProfiles = null, ContainerServiceLinuxProfile linuxProfile = null, ManagedClusterWindowsProfile windowsProfile = null, ManagedClusterServicePrincipalProfile servicePrincipalProfile = null, IDictionary addonProfiles = null, ManagedClusterPodIdentityProfile podIdentityProfile = null, ManagedClusterOidcIssuerProfile oidcIssuerProfile = null, string nodeResourceGroup = null, bool? enableRbac = null, KubernetesSupportPlan? supportPlan = null, bool? enablePodSecurityPolicy = null, ContainerServiceNetworkProfile networkProfile = null, ManagedClusterAadProfile aadProfile = null, ManagedClusterAutoUpgradeProfile autoUpgradeProfile = null, UpgradeOverrideSettings upgradeOverrideSettings = null, ManagedClusterAutoScalerProfile autoScalerProfile = null, ManagedClusterApiServerAccessProfile apiServerAccessProfile = null, ResourceIdentifier diskEncryptionSetId = null, IDictionary identityProfile = null, IEnumerable privateLinkResources = null, bool? disableLocalAccounts = null, ManagedClusterHttpProxyConfig httpProxyConfig = null, ManagedClusterSecurityProfile securityProfile = null, ManagedClusterStorageProfile storageProfile = null, ContainerServicePublicNetworkAccess? publicNetworkAccess = null, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = null, ManagedClusterMonitorProfileMetrics azureMonitorMetrics = null, ServiceMeshProfile serviceMeshProfile = null, ResourceIdentifier resourceId = null) + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// Managed identity. + /// The status of the last operation. + /// The FleetHubProfile configures the Fleet's hub. + /// A new instance for mocking. + public static FleetData FleetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, ResourceManager.Models.ManagedServiceIdentity identity = null, FleetProvisioningState? provisioningState = null, FleetHubProfile hubProfile = null) { tags ??= new Dictionary(); - agentPoolProfiles ??= new List(); - addonProfiles ??= new Dictionary(); - identityProfile ??= new Dictionary(); - privateLinkResources ??= new List(); - return new ContainerServiceManagedClusterData( + return new FleetData( id, name, resourceType, systemData, tags, location, - sku, - extendedLocation, - clusterIdentity, - provisioningState, - powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, - maxAgentPools, - kubernetesVersion, - currentKubernetesVersion, - dnsPrefix, - fqdnSubdomain, - fqdn, - privateFqdn, - azurePortalFqdn, - agentPoolProfiles?.ToList(), - linuxProfile, - windowsProfile, - servicePrincipalProfile, - addonProfiles, - podIdentityProfile, - oidcIssuerProfile, - nodeResourceGroup, - enableRbac, - supportPlan, - enablePodSecurityPolicy, - networkProfile, - aadProfile, - autoUpgradeProfile, - upgradeOverrideSettings != null ? new ClusterUpgradeSettings(upgradeOverrideSettings, serializedAdditionalRawData: null) : null, - autoScalerProfile, - apiServerAccessProfile, - diskEncryptionSetId, - identityProfile, - privateLinkResources?.ToList(), - disableLocalAccounts, - httpProxyConfig, - securityProfile, - storageProfile, - publicNetworkAccess, - workloadAutoScalerProfile, - azureMonitorMetrics != null ? new ManagedClusterAzureMonitorProfile(azureMonitorMetrics, serializedAdditionalRawData: null) : null, - serviceMeshProfile, - resourceId, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// Windows agent pool names must be 6 characters or less. - /// A new instance for mocking. - public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null, string name = null) - { - availabilityZones ??= new List(); - tags ??= new Dictionary(); - nodeLabels ??= new Dictionary(); - nodeTaints ??= new List(); - - return new ManagedClusterAgentPoolProfile( - count, - vmSize, - osDiskSizeInGB, - osDiskType, - kubeletDiskType, - workloadRuntime, - vnetSubnetId, - podSubnetId, - maxPods, - osType, - osSku, - maxCount, - minCount, - enableAutoScaling, - scaleDownMode, - agentPoolType, - mode, - orchestratorVersion, - currentOrchestratorVersion, - nodeImageVersion, - upgradeSettings, - provisioningState, - powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, - availabilityZones?.ToList(), - enableNodePublicIP, - nodePublicIPPrefixId, - scaleSetPriority, - scaleSetEvictionPolicy, - spotMaxPrice, - tags, - nodeLabels, - nodeTaints?.ToList(), - proximityPlacementGroupId, - kubeletConfig, - linuxOSConfig, - enableEncryptionAtHost, - enableUltraSsd, - enableFips, - gpuInstanceProfile, - creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, - capacityReservationGroupId, - hostGroupId, - networkProfile, - serializedAdditionalRawData: null, - name); - } - - /// Initializes a new instance of . - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// A new instance for mocking. - public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null) - { - availabilityZones ??= new List(); - tags ??= new Dictionary(); - nodeLabels ??= new Dictionary(); - nodeTaints ??= new List(); - - return new ManagedClusterAgentPoolProfileProperties( - count, - vmSize, - osDiskSizeInGB, - osDiskType, - kubeletDiskType, - workloadRuntime, - vnetSubnetId, - podSubnetId, - maxPods, - osType, - osSku, - maxCount, - minCount, - enableAutoScaling, - scaleDownMode, - agentPoolType, - mode, - orchestratorVersion, - currentOrchestratorVersion, - nodeImageVersion, - upgradeSettings, - provisioningState, - powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, - availabilityZones?.ToList(), - enableNodePublicIP, - nodePublicIPPrefixId, - scaleSetPriority, - scaleSetEvictionPolicy, - spotMaxPrice, - tags, - nodeLabels, - nodeTaints?.ToList(), - proximityPlacementGroupId, - kubeletConfig, - linuxOSConfig, - enableEncryptionAtHost, - enableUltraSsd, - enableFips, - gpuInstanceProfile, - creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, - capacityReservationGroupId, - hostGroupId, - networkProfile, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Whether the add-on is enabled or not. - /// Key-value pairs for configuring an add-on. - /// Information of user assigned identity used by this add-on. - /// A new instance for mocking. - public static ManagedClusterAddonProfile ManagedClusterAddonProfile(bool isEnabled = default, IDictionary config = null, ManagedClusterAddonProfileIdentity identity = null) - { - config ??= new Dictionary(); - - return new ManagedClusterAddonProfile(isEnabled, config, identity, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The name of the pod identity. - /// The namespace of the pod identity. - /// The binding selector to use for the AzureIdentityBinding resource. - /// The user assigned identity details. - /// The current provisioning state of the pod identity. - /// - /// A new instance for mocking. - public static ManagedClusterPodIdentity ManagedClusterPodIdentity(string name = null, string @namespace = null, string bindingSelector = null, ContainerServiceUserAssignedIdentity identity = null, ManagedClusterPodIdentityProvisioningState? provisioningState = null, ResponseError errorDetail = null) - { - return new ManagedClusterPodIdentity( - name, - @namespace, - bindingSelector, + etag, identity, provisioningState, - errorDetail != null ? new ManagedClusterPodIdentityProvisioningInfo(new ManagedClusterPodIdentityProvisioningError(errorDetail, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The OIDC issuer url of the Managed Cluster. - /// Whether the OIDC issuer is enabled. - /// A new instance for mocking. - public static ManagedClusterOidcIssuerProfile ManagedClusterOidcIssuerProfile(string issuerUriInfo = null, bool? isEnabled = null) - { - return new ManagedClusterOidcIssuerProfile(issuerUriInfo, isEnabled, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The ID of the private link resource. - /// The name of the private link resource. - /// The resource type. - /// The group ID of the resource. - /// The RequiredMembers of the resource. - /// The private link service ID of the resource, this field is exposed only to NRP internally. - /// A new instance for mocking. - public static ContainerServicePrivateLinkResourceData ContainerServicePrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, string groupId = null, IEnumerable requiredMembers = null, ResourceIdentifier privateLinkServiceId = null) - { - requiredMembers ??= new List(); - - return new ContainerServicePrivateLinkResourceData( - id, - name, - resourceType, - groupId, - requiredMembers?.ToList(), - privateLinkServiceId, + hubProfile, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of available upgrade versions for the control plane. - /// The list of available upgrade versions for agent pools. - /// A new instance for mocking. - public static ManagedClusterUpgradeProfileData ManagedClusterUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedClusterPoolUpgradeProfile controlPlaneProfile = null, IEnumerable agentPoolProfiles = null) + /// Initializes a new instance of . + /// DNS prefix used to create the FQDN for the Fleet hub. + /// The access profile for the Fleet hub API server. + /// The agent profile for the Fleet hub. + /// The FQDN of the Fleet hub. + /// The Kubernetes version of the Fleet hub. + /// The Azure Portal FQDN of the Fleet hub. + /// A new instance for mocking. + public static FleetHubProfile FleetHubProfile(string dnsPrefix = null, bool? enablePrivateCluster = null, AgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null) { - agentPoolProfiles ??= new List(); - - return new ManagedClusterUpgradeProfileData( - id, - name, - resourceType, - systemData, - controlPlaneProfile, - agentPoolProfiles?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// The Agent Pool name. - /// The operating system type. The default is Linux. - /// List of orchestrator types and versions available for upgrade. - /// A new instance for mocking. - public static ManagedClusterPoolUpgradeProfile ManagedClusterPoolUpgradeProfile(string kubernetesVersion = null, string name = null, ContainerServiceOSType osType = default, IEnumerable upgrades = null) - { - upgrades ??= new List(); - - return new ManagedClusterPoolUpgradeProfile(kubernetesVersion, name, osType, upgrades?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// Whether the Kubernetes version is currently in preview. - /// A new instance for mocking. - public static ManagedClusterPoolUpgradeProfileUpgradesItem ManagedClusterPoolUpgradeProfileUpgradesItem(string kubernetesVersion = null, bool? isPreview = null) - { - return new ManagedClusterPoolUpgradeProfileUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Base64-encoded Kubernetes configuration file. - /// A new instance for mocking. - public static ManagedClusterAccessProfile ManagedClusterAccessProfile(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, byte[] kubeConfig = null) - { - tags ??= new Dictionary(); - - return new ManagedClusterAccessProfile( - id, - name, - resourceType, - systemData, - tags, - location, - kubeConfig, + return new FleetHubProfile( + dnsPrefix, + enablePrivateCluster != null ? new ApiServerAccessProfile(enablePrivateCluster, serializedAdditionalRawData: null) : null, + agentProfile, + fqdn, + kubernetesVersion, + portalFqdn, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Base64-encoded Kubernetes configuration file. - /// A new instance for mocking. - public static ManagedClusterCredentials ManagedClusterCredentials(IEnumerable kubeconfigs = null) + /// Initializes a new instance of . + /// Array of base64-encoded Kubernetes configuration files. + /// A new instance for mocking. + public static FleetCredentialResults FleetCredentialResults(IEnumerable kubeconfigs = null) { - kubeconfigs ??= new List(); + kubeconfigs ??= new List(); - return new ManagedClusterCredentials(kubeconfigs?.ToList(), serializedAdditionalRawData: null); + return new FleetCredentialResults(kubeconfigs?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the credential. /// Base64-encoded Kubernetes configuration file. - /// A new instance for mocking. - public static ManagedClusterCredential ManagedClusterCredential(string name = null, byte[] value = null) + /// A new instance for mocking. + public static FleetCredentialResult FleetCredentialResult(string name = null, byte[] value = null) { - return new ManagedClusterCredential(name, value, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - /// Time slots on which upgrade is not allowed. - /// Maintenance window for the maintenance configuration. - /// A new instance for mocking. - public static ContainerServiceMaintenanceConfigurationData ContainerServiceMaintenanceConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable timesInWeek = null, IEnumerable notAllowedTimes = null, ContainerServiceMaintenanceWindow maintenanceWindow = null) - { - timesInWeek ??= new List(); - notAllowedTimes ??= new List(); - - return new ContainerServiceMaintenanceConfigurationData( - id, - name, - resourceType, - systemData, - timesInWeek?.ToList(), - notAllowedTimes?.ToList(), - maintenanceWindow, - serializedAdditionalRawData: null); + return new FleetCredentialResult(name, value, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// A new instance for mocking. - public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? typePropertiesType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null) - { - availabilityZones ??= new List(); - tags ??= new Dictionary(); - nodeLabels ??= new Dictionary(); - nodeTaints ??= new List(); - - return new ContainerServiceAgentPoolData( + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'. + /// The group this member belongs to for multi-cluster update management. + /// The status of the last operation. + /// A new instance for mocking. + public static FleetMemberData FleetMemberData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? etag = null, ResourceIdentifier clusterResourceId = null, string group = null, FleetMemberProvisioningState? provisioningState = null) + { + return new FleetMemberData( id, name, resourceType, systemData, - count, - vmSize, - osDiskSizeInGB, - osDiskType, - kubeletDiskType, - workloadRuntime, - vnetSubnetId, - podSubnetId, - maxPods, - osType, - osSku, - maxCount, - minCount, - enableAutoScaling, - scaleDownMode, - typePropertiesType, - mode, - orchestratorVersion, - currentOrchestratorVersion, - nodeImageVersion, - upgradeSettings, + etag, + clusterResourceId, + group, provisioningState, - powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, - availabilityZones?.ToList(), - enableNodePublicIP, - nodePublicIPPrefixId, - scaleSetPriority, - scaleSetEvictionPolicy, - spotMaxPrice, - tags, - nodeLabels, - nodeTaints?.ToList(), - proximityPlacementGroupId, - kubeletConfig, - linuxOSConfig, - enableEncryptionAtHost, - enableUltraSsd, - enableFips, - gpuInstanceProfile, - creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, - capacityReservationGroupId, - hostGroupId, - networkProfile, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The Kubernetes version (major.minor.patch). - /// The operating system type. The default is Linux. - /// List of orchestrator types and versions available for upgrade. - /// The latest AKS supported node image version. - /// A new instance for mocking. - public static AgentPoolUpgradeProfileData AgentPoolUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string kubernetesVersion = null, ContainerServiceOSType osType = default, IEnumerable upgrades = null, string latestNodeImageVersion = null) - { - upgrades ??= new List(); - - return new AgentPoolUpgradeProfileData( - id, - name, - resourceType, - systemData, - kubernetesVersion, - osType, - upgrades?.ToList(), - latestNodeImageVersion, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// Whether the Kubernetes version is currently in preview. - /// A new instance for mocking. - public static AgentPoolUpgradeProfilePropertiesUpgradesItem AgentPoolUpgradeProfilePropertiesUpgradesItem(string kubernetesVersion = null, bool? isPreview = null) - { - return new AgentPoolUpgradeProfilePropertiesUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// List of versions available for agent pool. - /// A new instance for mocking. - public static AgentPoolAvailableVersions AgentPoolAvailableVersions(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable agentPoolVersions = null) - { - agentPoolVersions ??= new List(); - - return new AgentPoolAvailableVersions( - id, - name, - resourceType, - systemData, - agentPoolVersions?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Whether this version is the default agent pool version. - /// The Kubernetes version (major.minor.patch). - /// Whether Kubernetes version is currently in preview. - /// A new instance for mocking. - public static AgentPoolAvailableVersion AgentPoolAvailableVersion(bool? isDefault = null, string kubernetesVersion = null, bool? isPreview = null) - { - return new AgentPoolAvailableVersion(isDefault, kubernetesVersion, isPreview, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The current provisioning state. - /// The resource of private endpoint. - /// A collection of information about the state of the connection between service consumer and provider. - /// A new instance for mocking. - public static ContainerServicePrivateEndpointConnectionData ContainerServicePrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerServicePrivateEndpointConnectionProvisioningState? provisioningState = null, ResourceIdentifier privateEndpointId = null, ContainerServicePrivateLinkServiceConnectionState connectionState = null) - { - return new ContainerServicePrivateEndpointConnectionData( + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// The provisioning state of the UpdateRun resource. + /// + /// The resource id of the FleetUpdateStrategy resource to reference. + /// + /// When creating a new run, there are three ways to define a strategy for the run: + /// 1. Define a new strategy in place: Set the "strategy" field. + /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + /// + /// Setting both "updateStrategyId" and "strategy" is invalid. + /// + /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + /// + /// + /// The strategy defines the order in which the clusters will be updated. + /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. + /// The strategy of the UpdateRun can be modified until the run is started. + /// + /// The update to be applied to all clusters in the UpdateRun. The managedClusterUpdate can be modified until the run is started. + /// The status of the UpdateRun. + /// A new instance for mocking. + public static UpdateRunData UpdateRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? etag = null, UpdateRunProvisioningState? provisioningState = null, ResourceIdentifier updateStrategyId = null, IEnumerable strategyStages = null, ManagedClusterUpdate managedClusterUpdate = null, UpdateRunStatus status = null) + { + strategyStages ??= new List(); + + return new UpdateRunData( id, name, resourceType, systemData, + etag, provisioningState, - privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, - connectionState, + updateStrategyId, + strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null, + managedClusterUpdate, + status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The command to run. - /// A base64 encoded zip file containing the files required by the command. - /// AuthToken issued for AKS AAD Server App. - /// A new instance for mocking. - public static ManagedClusterRunCommandContent ManagedClusterRunCommandContent(string command = null, string context = null, string clusterToken = null) + /// Initializes a new instance of . + /// The status of the UpdateRun. + /// The stages composing an update run. Stages are run sequentially withing an UpdateRun. + /// The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is `Consistent`. + /// A new instance for mocking. + public static UpdateRunStatus UpdateRunStatus(UpdateStatus status = null, IEnumerable stages = null, IEnumerable selectedNodeImageVersions = null) { - return new ManagedClusterRunCommandContent(command, context, clusterToken, serializedAdditionalRawData: null); - } + stages ??= new List(); + selectedNodeImageVersions ??= new List(); - /// Initializes a new instance of . - /// The command id. - /// provisioning State. - /// The exit code of the command. - /// The time when the command started. - /// The time when the command finished. - /// The command output. - /// An explanation of why provisioningState is set to failed (if so). - /// A new instance for mocking. - public static ManagedClusterRunCommandResult ManagedClusterRunCommandResult(string id = null, string provisioningState = null, int? exitCode = null, DateTimeOffset? startedOn = null, DateTimeOffset? finishedOn = null, string logs = null, string reason = null) - { - return new ManagedClusterRunCommandResult( - id, - provisioningState, - exitCode, - startedOn, - finishedOn, - logs, - reason, - serializedAdditionalRawData: null); + return new UpdateRunStatus(status, stages?.ToList(), selectedNodeImageVersions != null ? new NodeImageSelectionStatus(selectedNodeImageVersions?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - /// The endpoints that AKS agent nodes connect to. - /// A new instance for mocking. - public static ContainerServiceOutboundEnvironmentEndpoint ContainerServiceOutboundEnvironmentEndpoint(string category = null, IEnumerable endpoints = null) + /// Initializes a new instance of . + /// The time the operation or group was started. + /// The time the operation or group was completed. + /// The State of the operation or group. + /// The error details when a failure is encountered. + /// A new instance for mocking. + public static UpdateStatus UpdateStatus(DateTimeOffset? startOn = null, DateTimeOffset? completedOn = null, UpdateState? state = null, ResponseError error = null) { - endpoints ??= new List(); - - return new ContainerServiceOutboundEnvironmentEndpoint(category, endpoints?.ToList(), serializedAdditionalRawData: null); + return new UpdateStatus(startOn, completedOn, state, error, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The domain name of the dependency. - /// The Ports and Protocols used when connecting to domainName. - /// A new instance for mocking. - public static ContainerServiceEndpointDependency ContainerServiceEndpointDependency(string domainName = null, IEnumerable endpointDetails = null) + /// Initializes a new instance of . + /// The status of the UpdateStage. + /// The name of the UpdateStage. + /// The list of groups to be updated as part of this UpdateStage. + /// The status of the wait period configured on the UpdateStage. + /// A new instance for mocking. + public static UpdateStageStatus UpdateStageStatus(UpdateStatus status = null, string name = null, IEnumerable groups = null, WaitStatus afterStageWaitStatus = null) { - endpointDetails ??= new List(); + groups ??= new List(); - return new ContainerServiceEndpointDependency(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null); + return new UpdateStageStatus(status, name, groups?.ToList(), afterStageWaitStatus, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// An IP Address that Domain Name currently resolves to. - /// The port an endpoint is connected to. - /// The protocol used for connection. - /// Description of the detail. - /// A new instance for mocking. - public static ContainerServiceEndpointDetail ContainerServiceEndpointDetail(IPAddress ipAddress = null, int? port = null, string protocol = null, string description = null) + /// Initializes a new instance of . + /// The status of the UpdateGroup. + /// The name of the UpdateGroup. + /// The list of member this UpdateGroup updates. + /// A new instance for mocking. + public static UpdateGroupStatus UpdateGroupStatus(UpdateStatus status = null, string name = null, IEnumerable members = null) { - return new ContainerServiceEndpointDetail(ipAddress, port, protocol, description, serializedAdditionalRawData: null); + members ??= new List(); + + return new UpdateGroupStatus(status, name, members?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// CreationData to be used to specify the source agent pool resource ID to create this snapshot. - /// The type of a snapshot. The default is NodePool. - /// The version of Kubernetes. - /// The version of node image. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The size of the VM. - /// Whether to use a FIPS-enabled OS. - /// A new instance for mocking. - public static AgentPoolSnapshotData AgentPoolSnapshotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier creationDataSourceResourceId = null, SnapshotType? snapshotType = null, string kubernetesVersion = null, string nodeImageVersion = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, string vmSize = null, bool? enableFips = null) + /// Initializes a new instance of . + /// The status of the MemberUpdate operation. + /// The name of the FleetMember. + /// The Azure resource id of the target Kubernetes cluster. + /// The operation resource id of the latest attempt to perform the operation. + /// The status message after processing the member update operation. + /// A new instance for mocking. + public static MemberUpdateStatus MemberUpdateStatus(UpdateStatus status = null, string name = null, ResourceIdentifier clusterResourceId = null, string operationId = null, string message = null) { - tags ??= new Dictionary(); - - return new AgentPoolSnapshotData( - id, + return new MemberUpdateStatus( + status, name, - resourceType, - systemData, - tags, - location, - creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, - snapshotType, - kubernetesVersion, - nodeImageVersion, - osType, - osSku, - vmSize, - enableFips, + clusterResourceId, + operationId, + message, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Mesh revision profile properties for a mesh. - /// A new instance for mocking. - public static MeshRevisionProfileData MeshRevisionProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable meshRevisions = null) + /// Initializes a new instance of . + /// The status of the wait duration. + /// The wait duration configured in seconds. + /// A new instance for mocking. + public static WaitStatus WaitStatus(UpdateStatus status = null, int? waitDurationInSeconds = null) { - meshRevisions ??= new List(); - - return new MeshRevisionProfileData( - id, - name, - resourceType, - systemData, - meshRevisions != null ? new MeshRevisionProfileProperties(meshRevisions?.ToList(), serializedAdditionalRawData: null) : null, - serializedAdditionalRawData: null); + return new WaitStatus(status, waitDurationInSeconds, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Mesh upgrade profile properties for a major.minor release. - /// A new instance for mocking. - public static MeshUpgradeProfileData MeshUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MeshUpgradeProfileProperties properties = null) + /// Initializes a new instance of . + /// The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). + /// A new instance for mocking. + public static NodeImageVersion NodeImageVersion(string version = null) { - return new MeshUpgradeProfileData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); + return new NodeImageVersion(version, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The current provisioning state of trusted access role binding. - /// The ARM resource ID of source resource that trusted access is configured for. - /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. - /// A new instance for mocking. - public static ContainerServiceTrustedAccessRoleBindingData ContainerServiceTrustedAccessRoleBindingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerServiceTrustedAccessRoleBindingProvisioningState? provisioningState = null, ResourceIdentifier sourceResourceId = null, IEnumerable roles = null) + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// The provisioning state of the UpdateStrategy resource. + /// Defines the update sequence of the clusters. + /// A new instance for mocking. + public static FleetUpdateStrategyData FleetUpdateStrategyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? etag = null, FleetUpdateStrategyProvisioningState? provisioningState = null, IEnumerable strategyStages = null) { - roles ??= new List(); + strategyStages ??= new List(); - return new ContainerServiceTrustedAccessRoleBindingData( + return new FleetUpdateStrategyData( id, name, resourceType, systemData, + etag, provisioningState, - sourceResourceId, - roles?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Resource type of Azure resource. - /// Name of role, name is unique under a source resource type. - /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole). - /// A new instance for mocking. - public static ContainerServiceTrustedAccessRole ContainerServiceTrustedAccessRole(string sourceResourceType = null, string name = null, IEnumerable rules = null) - { - rules ??= new List(); - - return new ContainerServiceTrustedAccessRole(sourceResourceType, name, rules?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// List of allowed verbs. - /// List of allowed apiGroups. - /// List of allowed resources. - /// List of allowed names. - /// List of allowed nonResourceURLs. - /// A new instance for mocking. - public static ContainerServiceTrustedAccessRoleRule ContainerServiceTrustedAccessRoleRule(IEnumerable verbs = null, IEnumerable apiGroups = null, IEnumerable resources = null, IEnumerable resourceNames = null, IEnumerable nonResourceUrls = null) - { - verbs ??= new List(); - apiGroups ??= new List(); - resources ??= new List(); - resourceNames ??= new List(); - nonResourceUrls ??= new List(); - - return new ContainerServiceTrustedAccessRoleRule( - verbs?.ToList(), - apiGroups?.ToList(), - resources?.ToList(), - resourceNames?.ToList(), - nonResourceUrls?.ToList(), + strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs deleted file mode 100644 index 88b66a8d18dd..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetContainerServiceAgentPools method from an instance of . - /// - public partial class ContainerServiceAgentPoolCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServiceAgentPoolAgentPoolsClientDiagnostics; - private readonly AgentPoolsRestOperations _containerServiceAgentPoolAgentPoolsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceAgentPoolCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal ContainerServiceAgentPoolCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceAgentPoolAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceAgentPoolResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServiceAgentPoolResource.ResourceType, out string containerServiceAgentPoolAgentPoolsApiVersion); - _containerServiceAgentPoolAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceAgentPoolAgentPoolsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an agent pool in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the agent pool. - /// The agent pool to create or update. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an agent pool in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the agent pool. - /// The agent pool to create or update. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Get"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Get"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of agent pools in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools - /// - /// - /// Operation Id - /// AgentPools_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceAgentPoolResource(Client, ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(e)), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, "ContainerServiceAgentPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of agent pools in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools - /// - /// - /// Operation Id - /// AgentPools_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceAgentPoolResource(Client, ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(e)), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, "ContainerServiceAgentPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Exists"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string agentPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs deleted file mode 100644 index 61ffda08ee23..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs +++ /dev/null @@ -1,891 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ContainerServiceAgentPoolData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(VmSize)) - { - writer.WritePropertyName("vmSize"u8); - writer.WriteStringValue(VmSize); - } - if (Optional.IsDefined(OSDiskSizeInGB)) - { - writer.WritePropertyName("osDiskSizeGB"u8); - writer.WriteNumberValue(OSDiskSizeInGB.Value); - } - if (Optional.IsDefined(OSDiskType)) - { - writer.WritePropertyName("osDiskType"u8); - writer.WriteStringValue(OSDiskType.Value.ToString()); - } - if (Optional.IsDefined(KubeletDiskType)) - { - writer.WritePropertyName("kubeletDiskType"u8); - writer.WriteStringValue(KubeletDiskType.Value.ToString()); - } - if (Optional.IsDefined(WorkloadRuntime)) - { - writer.WritePropertyName("workloadRuntime"u8); - writer.WriteStringValue(WorkloadRuntime.Value.ToString()); - } - if (Optional.IsDefined(VnetSubnetId)) - { - writer.WritePropertyName("vnetSubnetID"u8); - writer.WriteStringValue(VnetSubnetId); - } - if (Optional.IsDefined(PodSubnetId)) - { - writer.WritePropertyName("podSubnetID"u8); - writer.WriteStringValue(PodSubnetId); - } - if (Optional.IsDefined(MaxPods)) - { - writer.WritePropertyName("maxPods"u8); - writer.WriteNumberValue(MaxPods.Value); - } - if (Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.Value.ToString()); - } - if (Optional.IsDefined(OSSku)) - { - writer.WritePropertyName("osSKU"u8); - writer.WriteStringValue(OSSku.Value.ToString()); - } - if (Optional.IsDefined(MaxCount)) - { - writer.WritePropertyName("maxCount"u8); - writer.WriteNumberValue(MaxCount.Value); - } - if (Optional.IsDefined(MinCount)) - { - writer.WritePropertyName("minCount"u8); - writer.WriteNumberValue(MinCount.Value); - } - if (Optional.IsDefined(EnableAutoScaling)) - { - writer.WritePropertyName("enableAutoScaling"u8); - writer.WriteBooleanValue(EnableAutoScaling.Value); - } - if (Optional.IsDefined(ScaleDownMode)) - { - writer.WritePropertyName("scaleDownMode"u8); - writer.WriteStringValue(ScaleDownMode.Value.ToString()); - } - if (Optional.IsDefined(TypePropertiesType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(TypePropertiesType.Value.ToString()); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(OrchestratorVersion)) - { - writer.WritePropertyName("orchestratorVersion"u8); - writer.WriteStringValue(OrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(CurrentOrchestratorVersion)) - { - writer.WritePropertyName("currentOrchestratorVersion"u8); - writer.WriteStringValue(CurrentOrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(NodeImageVersion)) - { - writer.WritePropertyName("nodeImageVersion"u8); - writer.WriteStringValue(NodeImageVersion); - } - if (Optional.IsDefined(UpgradeSettings)) - { - writer.WritePropertyName("upgradeSettings"u8); - writer.WriteObjectValue(UpgradeSettings, options); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (Optional.IsDefined(PowerState)) - { - writer.WritePropertyName("powerState"u8); - writer.WriteObjectValue(PowerState, options); - } - if (Optional.IsCollectionDefined(AvailabilityZones)) - { - writer.WritePropertyName("availabilityZones"u8); - writer.WriteStartArray(); - foreach (var item in AvailabilityZones) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(EnableNodePublicIP)) - { - writer.WritePropertyName("enableNodePublicIP"u8); - writer.WriteBooleanValue(EnableNodePublicIP.Value); - } - if (Optional.IsDefined(NodePublicIPPrefixId)) - { - writer.WritePropertyName("nodePublicIPPrefixID"u8); - writer.WriteStringValue(NodePublicIPPrefixId); - } - if (Optional.IsDefined(ScaleSetPriority)) - { - writer.WritePropertyName("scaleSetPriority"u8); - writer.WriteStringValue(ScaleSetPriority.Value.ToString()); - } - if (Optional.IsDefined(ScaleSetEvictionPolicy)) - { - writer.WritePropertyName("scaleSetEvictionPolicy"u8); - writer.WriteStringValue(ScaleSetEvictionPolicy.Value.ToString()); - } - if (Optional.IsDefined(SpotMaxPrice)) - { - writer.WritePropertyName("spotMaxPrice"u8); - writer.WriteNumberValue(SpotMaxPrice.Value); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(NodeLabels)) - { - writer.WritePropertyName("nodeLabels"u8); - writer.WriteStartObject(); - foreach (var item in NodeLabels) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(NodeTaints)) - { - writer.WritePropertyName("nodeTaints"u8); - writer.WriteStartArray(); - foreach (var item in NodeTaints) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ProximityPlacementGroupId)) - { - writer.WritePropertyName("proximityPlacementGroupID"u8); - writer.WriteStringValue(ProximityPlacementGroupId); - } - if (Optional.IsDefined(KubeletConfig)) - { - writer.WritePropertyName("kubeletConfig"u8); - writer.WriteObjectValue(KubeletConfig, options); - } - if (Optional.IsDefined(LinuxOSConfig)) - { - writer.WritePropertyName("linuxOSConfig"u8); - writer.WriteObjectValue(LinuxOSConfig, options); - } - if (Optional.IsDefined(EnableEncryptionAtHost)) - { - writer.WritePropertyName("enableEncryptionAtHost"u8); - writer.WriteBooleanValue(EnableEncryptionAtHost.Value); - } - if (Optional.IsDefined(EnableUltraSsd)) - { - writer.WritePropertyName("enableUltraSSD"u8); - writer.WriteBooleanValue(EnableUltraSsd.Value); - } - if (Optional.IsDefined(EnableFips)) - { - writer.WritePropertyName("enableFIPS"u8); - writer.WriteBooleanValue(EnableFips.Value); - } - if (Optional.IsDefined(GpuInstanceProfile)) - { - writer.WritePropertyName("gpuInstanceProfile"u8); - writer.WriteStringValue(GpuInstanceProfile.Value.ToString()); - } - if (Optional.IsDefined(CreationData)) - { - writer.WritePropertyName("creationData"u8); - writer.WriteObjectValue(CreationData, options); - } - if (Optional.IsDefined(CapacityReservationGroupId)) - { - writer.WritePropertyName("capacityReservationGroupID"u8); - writer.WriteStringValue(CapacityReservationGroupId); - } - if (Optional.IsDefined(HostGroupId)) - { - writer.WritePropertyName("hostGroupID"u8); - writer.WriteStringValue(HostGroupId); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceAgentPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceAgentPoolData(document.RootElement, options); - } - - internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPoolData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - int? count = default; - string vmSize = default; - int? osDiskSizeGB = default; - ContainerServiceOSDiskType? osDiskType = default; - KubeletDiskType? kubeletDiskType = default; - WorkloadRuntime? workloadRuntime = default; - ResourceIdentifier vnetSubnetId = default; - ResourceIdentifier podSubnetId = default; - int? maxPods = default; - ContainerServiceOSType? osType = default; - ContainerServiceOSSku? osSku = default; - int? maxCount = default; - int? minCount = default; - bool? enableAutoScaling = default; - ScaleDownMode? scaleDownMode = default; - AgentPoolType? type0 = default; - AgentPoolMode? mode = default; - string orchestratorVersion = default; - string currentOrchestratorVersion = default; - string nodeImageVersion = default; - AgentPoolUpgradeSettings upgradeSettings = default; - string provisioningState = default; - ContainerServicePowerState powerState = default; - IList availabilityZones = default; - bool? enableNodePublicIP = default; - ResourceIdentifier nodePublicIPPrefixId = default; - ScaleSetPriority? scaleSetPriority = default; - ScaleSetEvictionPolicy? scaleSetEvictionPolicy = default; - float? spotMaxPrice = default; - IDictionary tags = default; - IDictionary nodeLabels = default; - IList nodeTaints = default; - ResourceIdentifier proximityPlacementGroupId = default; - KubeletConfig kubeletConfig = default; - LinuxOSConfig linuxOSConfig = default; - bool? enableEncryptionAtHost = default; - bool? enableUltraSsd = default; - bool? enableFIPS = default; - GpuInstanceProfile? gpuInstanceProfile = default; - ContainerServiceCreationData creationData = default; - ResourceIdentifier capacityReservationGroupId = default; - ResourceIdentifier hostGroupId = default; - AgentPoolNetworkProfile networkProfile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("count"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("vmSize"u8)) - { - vmSize = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("osDiskSizeGB"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskSizeGB = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("osDiskType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskType = new ContainerServiceOSDiskType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("kubeletDiskType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletDiskType = new KubeletDiskType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("workloadRuntime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadRuntime = new WorkloadRuntime(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("vnetSubnetID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vnetSubnetId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("podSubnetID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podSubnetId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxPods"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxPods = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("osType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osType = new ContainerServiceOSType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("osSKU"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osSku = new ContainerServiceOSSku(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("minCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - minCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("enableAutoScaling"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableAutoScaling = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("scaleDownMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleDownMode = new ScaleDownMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("type"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type0 = new AgentPoolType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("mode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new AgentPoolMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("orchestratorVersion"u8)) - { - orchestratorVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("currentOrchestratorVersion"u8)) - { - currentOrchestratorVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("nodeImageVersion"u8)) - { - nodeImageVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("upgradeSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeSettings = AgentPoolUpgradeSettings.DeserializeAgentPoolUpgradeSettings(property0.Value, options); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("powerState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - powerState = ContainerServicePowerState.DeserializeContainerServicePowerState(property0.Value, options); - continue; - } - if (property0.NameEquals("availabilityZones"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - availabilityZones = array; - continue; - } - if (property0.NameEquals("enableNodePublicIP"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableNodePublicIP = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("nodePublicIPPrefixID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nodePublicIPPrefixId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("scaleSetPriority"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetPriority = new ScaleSetPriority(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("scaleSetEvictionPolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetEvictionPolicy = new ScaleSetEvictionPolicy(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("spotMaxPrice"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - spotMaxPrice = property0.Value.GetSingle(); - continue; - } - if (property0.NameEquals("tags"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property0.NameEquals("nodeLabels"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - nodeLabels = dictionary; - continue; - } - if (property0.NameEquals("nodeTaints"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nodeTaints = array; - continue; - } - if (property0.NameEquals("proximityPlacementGroupID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - proximityPlacementGroupId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("kubeletConfig"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletConfig = KubeletConfig.DeserializeKubeletConfig(property0.Value, options); - continue; - } - if (property0.NameEquals("linuxOSConfig"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - linuxOSConfig = LinuxOSConfig.DeserializeLinuxOSConfig(property0.Value, options); - continue; - } - if (property0.NameEquals("enableEncryptionAtHost"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableEncryptionAtHost = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("enableUltraSSD"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableUltraSsd = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("enableFIPS"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFIPS = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("gpuInstanceProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gpuInstanceProfile = new GpuInstanceProfile(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("creationData"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - creationData = ContainerServiceCreationData.DeserializeContainerServiceCreationData(property0.Value, options); - continue; - } - if (property0.NameEquals("capacityReservationGroupID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityReservationGroupId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("hostGroupID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - hostGroupId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("networkProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceAgentPoolData( - id, - name, - type, - systemData, - count, - vmSize, - osDiskSizeGB, - osDiskType, - kubeletDiskType, - workloadRuntime, - vnetSubnetId, - podSubnetId, - maxPods, - osType, - osSku, - maxCount, - minCount, - enableAutoScaling, - scaleDownMode, - type0, - mode, - orchestratorVersion, - currentOrchestratorVersion, - nodeImageVersion, - upgradeSettings, - provisioningState, - powerState, - availabilityZones ?? new ChangeTrackingList(), - enableNodePublicIP, - nodePublicIPPrefixId, - scaleSetPriority, - scaleSetEvictionPolicy, - spotMaxPrice, - tags ?? new ChangeTrackingDictionary(), - nodeLabels ?? new ChangeTrackingDictionary(), - nodeTaints ?? new ChangeTrackingList(), - proximityPlacementGroupId, - kubeletConfig, - linuxOSConfig, - enableEncryptionAtHost, - enableUltraSsd, - enableFIPS, - gpuInstanceProfile, - creationData, - capacityReservationGroupId, - hostGroupId, - networkProfile, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolData)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceAgentPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceAgentPoolData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs deleted file mode 100644 index 0cba3bcad288..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServiceAgentPool data model. - /// Agent Pool. - /// - public partial class ContainerServiceAgentPoolData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ContainerServiceAgentPoolData() - { - AvailabilityZones = new ChangeTrackingList(); - Tags = new ChangeTrackingDictionary(); - NodeLabels = new ChangeTrackingDictionary(); - NodeTaints = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? typePropertiesType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Count = count; - VmSize = vmSize; - OSDiskSizeInGB = osDiskSizeInGB; - OSDiskType = osDiskType; - KubeletDiskType = kubeletDiskType; - WorkloadRuntime = workloadRuntime; - VnetSubnetId = vnetSubnetId; - PodSubnetId = podSubnetId; - MaxPods = maxPods; - OSType = osType; - OSSku = osSku; - MaxCount = maxCount; - MinCount = minCount; - EnableAutoScaling = enableAutoScaling; - ScaleDownMode = scaleDownMode; - TypePropertiesType = typePropertiesType; - Mode = mode; - OrchestratorVersion = orchestratorVersion; - CurrentOrchestratorVersion = currentOrchestratorVersion; - NodeImageVersion = nodeImageVersion; - UpgradeSettings = upgradeSettings; - ProvisioningState = provisioningState; - PowerState = powerState; - AvailabilityZones = availabilityZones; - EnableNodePublicIP = enableNodePublicIP; - NodePublicIPPrefixId = nodePublicIPPrefixId; - ScaleSetPriority = scaleSetPriority; - ScaleSetEvictionPolicy = scaleSetEvictionPolicy; - SpotMaxPrice = spotMaxPrice; - Tags = tags; - NodeLabels = nodeLabels; - NodeTaints = nodeTaints; - ProximityPlacementGroupId = proximityPlacementGroupId; - KubeletConfig = kubeletConfig; - LinuxOSConfig = linuxOSConfig; - EnableEncryptionAtHost = enableEncryptionAtHost; - EnableUltraSsd = enableUltraSsd; - EnableFips = enableFips; - GpuInstanceProfile = gpuInstanceProfile; - CreationData = creationData; - CapacityReservationGroupId = capacityReservationGroupId; - HostGroupId = hostGroupId; - NetworkProfile = networkProfile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - public int? Count { get; set; } - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - public string VmSize { get; set; } - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - public int? OSDiskSizeInGB { get; set; } - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - public ContainerServiceOSDiskType? OSDiskType { get; set; } - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - public KubeletDiskType? KubeletDiskType { get; set; } - /// Determines the type of workload a node can run. - public WorkloadRuntime? WorkloadRuntime { get; set; } - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - public ResourceIdentifier VnetSubnetId { get; set; } - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - public ResourceIdentifier PodSubnetId { get; set; } - /// The maximum number of pods that can run on a node. - public int? MaxPods { get; set; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType? OSType { get; set; } - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - public ContainerServiceOSSku? OSSku { get; set; } - /// The maximum number of nodes for auto-scaling. - public int? MaxCount { get; set; } - /// The minimum number of nodes for auto-scaling. - public int? MinCount { get; set; } - /// Whether to enable auto-scaler. - public bool? EnableAutoScaling { get; set; } - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - public ScaleDownMode? ScaleDownMode { get; set; } - /// The type of Agent Pool. - public AgentPoolType? TypePropertiesType { get; set; } - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - public AgentPoolMode? Mode { get; set; } - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - public string OrchestratorVersion { get; set; } - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - public string CurrentOrchestratorVersion { get; } - /// The version of node image. - public string NodeImageVersion { get; } - /// Settings for upgrading the agentpool. - public AgentPoolUpgradeSettings UpgradeSettings { get; set; } - /// The current deployment or provisioning state. - public string ProvisioningState { get; } - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - internal ContainerServicePowerState PowerState { get; set; } - /// Tells whether the cluster is Running or Stopped. - public ContainerServiceStateCode? PowerStateCode - { - get => PowerState is null ? default : PowerState.Code; - set - { - if (PowerState is null) - PowerState = new ContainerServicePowerState(); - PowerState.Code = value; - } - } - - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - public IList AvailabilityZones { get; } - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - public bool? EnableNodePublicIP { get; set; } - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - public ResourceIdentifier NodePublicIPPrefixId { get; set; } - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - public ScaleSetPriority? ScaleSetPriority { get; set; } - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - public ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get; set; } - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - public float? SpotMaxPrice { get; set; } - /// The tags to be persisted on the agent pool virtual machine scale set. - public IDictionary Tags { get; } - /// The node labels to be persisted across all nodes in agent pool. - public IDictionary NodeLabels { get; } - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - public IList NodeTaints { get; } - /// The ID for Proximity Placement Group. - public ResourceIdentifier ProximityPlacementGroupId { get; set; } - /// The Kubelet configuration on the agent pool nodes. - public KubeletConfig KubeletConfig { get; set; } - /// The OS configuration of Linux agent nodes. - public LinuxOSConfig LinuxOSConfig { get; set; } - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - public bool? EnableEncryptionAtHost { get; set; } - /// Whether to enable UltraSSD. - public bool? EnableUltraSsd { get; set; } - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - public bool? EnableFips { get; set; } - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - public GpuInstanceProfile? GpuInstanceProfile { get; set; } - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - internal ContainerServiceCreationData CreationData { get; set; } - /// This is the ARM ID of the source object to be used to create the target object. - public ResourceIdentifier CreationDataSourceResourceId - { - get => CreationData is null ? default : CreationData.SourceResourceId; - set - { - if (CreationData is null) - CreationData = new ContainerServiceCreationData(); - CreationData.SourceResourceId = value; - } - } - - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - public ResourceIdentifier CapacityReservationGroupId { get; set; } - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - public ResourceIdentifier HostGroupId { get; set; } - /// Network-related settings of an agent pool. - public AgentPoolNetworkProfile NetworkProfile { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.Serialization.cs deleted file mode 100644 index c96ca2cec37b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ContainerServiceAgentPoolResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ContainerServiceAgentPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ContainerServiceAgentPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs deleted file mode 100644 index f608a529017b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs +++ /dev/null @@ -1,497 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetContainerServiceMaintenanceConfigurations method from an instance of . - /// - public partial class ContainerServiceMaintenanceConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics; - private readonly MaintenanceConfigurationsRestOperations _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceMaintenanceConfigurationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal ContainerServiceMaintenanceConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceMaintenanceConfigurationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServiceMaintenanceConfigurationResource.ResourceType, out string containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion); - _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient = new MaintenanceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the maintenance configuration. - /// The maintenance configuration to create or update. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data, cancellationToken).ConfigureAwait(false); - var uri = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the maintenance configuration. - /// The maintenance configuration to create or update. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data, cancellationToken); - var uri = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Get"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Get"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of maintenance configurations in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations - /// - /// - /// Operation Id - /// MaintenanceConfigurations_ListByManagedCluster - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceMaintenanceConfigurationResource(Client, ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(e)), _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics, Pipeline, "ContainerServiceMaintenanceConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of maintenance configurations in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations - /// - /// - /// Operation Id - /// MaintenanceConfigurations_ListByManagedCluster - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceMaintenanceConfigurationResource(Client, ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(e)), _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics, Pipeline, "ContainerServiceMaintenanceConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs deleted file mode 100644 index 6f75ba50accb..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServiceMaintenanceConfiguration data model. - /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned maintenance. - /// - public partial class ContainerServiceMaintenanceConfigurationData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ContainerServiceMaintenanceConfigurationData() - { - TimesInWeek = new ChangeTrackingList(); - NotAllowedTimes = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - /// Time slots on which upgrade is not allowed. - /// Maintenance window for the maintenance configuration. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList timesInWeek, IList notAllowedTimes, ContainerServiceMaintenanceWindow maintenanceWindow, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - TimesInWeek = timesInWeek; - NotAllowedTimes = notAllowedTimes; - MaintenanceWindow = maintenanceWindow; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. - public IList TimesInWeek { get; } - /// Time slots on which upgrade is not allowed. - public IList NotAllowedTimes { get; } - /// Maintenance window for the maintenance configuration. - public ContainerServiceMaintenanceWindow MaintenanceWindow { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.Serialization.cs deleted file mode 100644 index 27789b642a4d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ContainerServiceMaintenanceConfigurationResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ContainerServiceMaintenanceConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ContainerServiceMaintenanceConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs deleted file mode 100644 index f1463e991c78..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a ContainerServiceMaintenanceConfiguration along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetContainerServiceMaintenanceConfigurationResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServiceMaintenanceConfiguration method. - /// - public partial class ContainerServiceMaintenanceConfigurationResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - /// The configName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string configName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics; - private readonly MaintenanceConfigurationsRestOperations _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient; - private readonly ContainerServiceMaintenanceConfigurationData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/maintenanceConfigurations"; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceMaintenanceConfigurationResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ContainerServiceMaintenanceConfigurationResource(ArmClient client, ContainerServiceMaintenanceConfigurationData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ContainerServiceMaintenanceConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion); - _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient = new MaintenanceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual ContainerServiceMaintenanceConfigurationData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Get"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Get"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a maintenance configuration. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Delete - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Delete"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a maintenance configuration. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Delete - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Delete"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The maintenance configuration to create or update. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Update"); - scope.Start(); - try - { - var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var uri = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The maintenance configuration to create or update. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationResource.Update"); - scope.Start(); - try - { - var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var uri = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs deleted file mode 100644 index a05f8d6c2d6d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetContainerServiceManagedClusters method from an instance of . - /// - public partial class ContainerServiceManagedClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServiceManagedClusterManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _containerServiceManagedClusterManagedClustersRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceManagedClusterCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal ContainerServiceManagedClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceManagedClusterManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceManagedClusterResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServiceManagedClusterResource.ResourceType, out string containerServiceManagedClusterManagedClustersApiVersion); - _containerServiceManagedClusterManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceManagedClusterManagedClustersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the managed cluster resource. - /// The managed cluster to create or update. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the managed cluster resource. - /// The managed cluster to create or update. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Get"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Get"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists managed clusters in the specified subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists managed clusters in the specified subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Exists"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs deleted file mode 100644 index b44313ff7c22..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs +++ /dev/null @@ -1,896 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ContainerServiceManagedClusterData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceManagedClusterData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"u8); - writer.WriteObjectValue(Sku, options); - } - if (Optional.IsDefined(ExtendedLocation)) - { - writer.WritePropertyName("extendedLocation"u8); - JsonSerializer.Serialize(writer, ExtendedLocation); - } - if (Optional.IsDefined(ClusterIdentity)) - { - writer.WritePropertyName("identity"u8); - writer.WriteObjectValue(ClusterIdentity, options); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (options.Format != "W" && Optional.IsDefined(PowerState)) - { - writer.WritePropertyName("powerState"u8); - writer.WriteObjectValue(PowerState, options); - } - if (options.Format != "W" && Optional.IsDefined(MaxAgentPools)) - { - writer.WritePropertyName("maxAgentPools"u8); - writer.WriteNumberValue(MaxAgentPools.Value); - } - if (Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (options.Format != "W" && Optional.IsDefined(CurrentKubernetesVersion)) - { - writer.WritePropertyName("currentKubernetesVersion"u8); - writer.WriteStringValue(CurrentKubernetesVersion); - } - if (Optional.IsDefined(DnsPrefix)) - { - writer.WritePropertyName("dnsPrefix"u8); - writer.WriteStringValue(DnsPrefix); - } - if (Optional.IsDefined(FqdnSubdomain)) - { - writer.WritePropertyName("fqdnSubdomain"u8); - writer.WriteStringValue(FqdnSubdomain); - } - if (options.Format != "W" && Optional.IsDefined(Fqdn)) - { - writer.WritePropertyName("fqdn"u8); - writer.WriteStringValue(Fqdn); - } - if (options.Format != "W" && Optional.IsDefined(PrivateFqdn)) - { - writer.WritePropertyName("privateFQDN"u8); - writer.WriteStringValue(PrivateFqdn); - } - if (options.Format != "W" && Optional.IsDefined(AzurePortalFqdn)) - { - writer.WritePropertyName("azurePortalFQDN"u8); - writer.WriteStringValue(AzurePortalFqdn); - } - if (Optional.IsCollectionDefined(AgentPoolProfiles)) - { - writer.WritePropertyName("agentPoolProfiles"u8); - writer.WriteStartArray(); - foreach (var item in AgentPoolProfiles) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(LinuxProfile)) - { - writer.WritePropertyName("linuxProfile"u8); - writer.WriteObjectValue(LinuxProfile, options); - } - if (Optional.IsDefined(WindowsProfile)) - { - writer.WritePropertyName("windowsProfile"u8); - writer.WriteObjectValue(WindowsProfile, options); - } - if (Optional.IsDefined(ServicePrincipalProfile)) - { - writer.WritePropertyName("servicePrincipalProfile"u8); - writer.WriteObjectValue(ServicePrincipalProfile, options); - } - if (Optional.IsCollectionDefined(AddonProfiles)) - { - writer.WritePropertyName("addonProfiles"u8); - writer.WriteStartObject(); - foreach (var item in AddonProfiles) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(PodIdentityProfile)) - { - writer.WritePropertyName("podIdentityProfile"u8); - writer.WriteObjectValue(PodIdentityProfile, options); - } - if (Optional.IsDefined(OidcIssuerProfile)) - { - writer.WritePropertyName("oidcIssuerProfile"u8); - writer.WriteObjectValue(OidcIssuerProfile, options); - } - if (Optional.IsDefined(NodeResourceGroup)) - { - writer.WritePropertyName("nodeResourceGroup"u8); - writer.WriteStringValue(NodeResourceGroup); - } - if (Optional.IsDefined(EnableRbac)) - { - writer.WritePropertyName("enableRBAC"u8); - writer.WriteBooleanValue(EnableRbac.Value); - } - if (Optional.IsDefined(SupportPlan)) - { - writer.WritePropertyName("supportPlan"u8); - writer.WriteStringValue(SupportPlan.Value.ToString()); - } - if (Optional.IsDefined(EnablePodSecurityPolicy)) - { - writer.WritePropertyName("enablePodSecurityPolicy"u8); - writer.WriteBooleanValue(EnablePodSecurityPolicy.Value); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile, options); - } - if (Optional.IsDefined(AadProfile)) - { - writer.WritePropertyName("aadProfile"u8); - writer.WriteObjectValue(AadProfile, options); - } - if (Optional.IsDefined(AutoUpgradeProfile)) - { - writer.WritePropertyName("autoUpgradeProfile"u8); - writer.WriteObjectValue(AutoUpgradeProfile, options); - } - if (Optional.IsDefined(UpgradeSettings)) - { - writer.WritePropertyName("upgradeSettings"u8); - writer.WriteObjectValue(UpgradeSettings, options); - } - if (Optional.IsDefined(AutoScalerProfile)) - { - writer.WritePropertyName("autoScalerProfile"u8); - writer.WriteObjectValue(AutoScalerProfile, options); - } - if (Optional.IsDefined(ApiServerAccessProfile)) - { - writer.WritePropertyName("apiServerAccessProfile"u8); - writer.WriteObjectValue(ApiServerAccessProfile, options); - } - if (Optional.IsDefined(DiskEncryptionSetId)) - { - writer.WritePropertyName("diskEncryptionSetID"u8); - writer.WriteStringValue(DiskEncryptionSetId); - } - if (Optional.IsCollectionDefined(IdentityProfile)) - { - writer.WritePropertyName("identityProfile"u8); - writer.WriteStartObject(); - foreach (var item in IdentityProfile) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(PrivateLinkResources)) - { - writer.WritePropertyName("privateLinkResources"u8); - writer.WriteStartArray(); - foreach (var item in PrivateLinkResources) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DisableLocalAccounts)) - { - writer.WritePropertyName("disableLocalAccounts"u8); - writer.WriteBooleanValue(DisableLocalAccounts.Value); - } - if (Optional.IsDefined(HttpProxyConfig)) - { - writer.WritePropertyName("httpProxyConfig"u8); - writer.WriteObjectValue(HttpProxyConfig, options); - } - if (Optional.IsDefined(SecurityProfile)) - { - writer.WritePropertyName("securityProfile"u8); - writer.WriteObjectValue(SecurityProfile, options); - } - if (Optional.IsDefined(StorageProfile)) - { - writer.WritePropertyName("storageProfile"u8); - writer.WriteObjectValue(StorageProfile, options); - } - if (Optional.IsDefined(PublicNetworkAccess)) - { - writer.WritePropertyName("publicNetworkAccess"u8); - writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); - } - if (Optional.IsDefined(WorkloadAutoScalerProfile)) - { - writer.WritePropertyName("workloadAutoScalerProfile"u8); - writer.WriteObjectValue(WorkloadAutoScalerProfile, options); - } - if (Optional.IsDefined(AzureMonitorProfile)) - { - writer.WritePropertyName("azureMonitorProfile"u8); - writer.WriteObjectValue(AzureMonitorProfile, options); - } - if (Optional.IsDefined(ServiceMeshProfile)) - { - writer.WritePropertyName("serviceMeshProfile"u8); - writer.WriteObjectValue(ServiceMeshProfile, options); - } - if (options.Format != "W" && Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceUID"u8); - writer.WriteStringValue(ResourceId); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceManagedClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceManagedClusterData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceManagedClusterData(document.RootElement, options); - } - - internal static ContainerServiceManagedClusterData DeserializeContainerServiceManagedClusterData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedClusterSku sku = default; - ExtendedLocation extendedLocation = default; - ManagedClusterIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - string provisioningState = default; - ContainerServicePowerState powerState = default; - int? maxAgentPools = default; - string kubernetesVersion = default; - string currentKubernetesVersion = default; - string dnsPrefix = default; - string fqdnSubdomain = default; - string fqdn = default; - string privateFQDN = default; - string azurePortalFQDN = default; - IList agentPoolProfiles = default; - ContainerServiceLinuxProfile linuxProfile = default; - ManagedClusterWindowsProfile windowsProfile = default; - ManagedClusterServicePrincipalProfile servicePrincipalProfile = default; - IDictionary addonProfiles = default; - ManagedClusterPodIdentityProfile podIdentityProfile = default; - ManagedClusterOidcIssuerProfile oidcIssuerProfile = default; - string nodeResourceGroup = default; - bool? enableRBAC = default; - KubernetesSupportPlan? supportPlan = default; - bool? enablePodSecurityPolicy = default; - ContainerServiceNetworkProfile networkProfile = default; - ManagedClusterAadProfile aadProfile = default; - ManagedClusterAutoUpgradeProfile autoUpgradeProfile = default; - ClusterUpgradeSettings upgradeSettings = default; - ManagedClusterAutoScalerProfile autoScalerProfile = default; - ManagedClusterApiServerAccessProfile apiServerAccessProfile = default; - ResourceIdentifier diskEncryptionSetId = default; - IDictionary identityProfile = default; - IList privateLinkResources = default; - bool? disableLocalAccounts = default; - ManagedClusterHttpProxyConfig httpProxyConfig = default; - ManagedClusterSecurityProfile securityProfile = default; - ManagedClusterStorageProfile storageProfile = default; - ContainerServicePublicNetworkAccess? publicNetworkAccess = default; - ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = default; - ManagedClusterAzureMonitorProfile azureMonitorProfile = default; - ServiceMeshProfile serviceMeshProfile = default; - ResourceIdentifier resourceUID = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sku"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sku = ManagedClusterSku.DeserializeManagedClusterSku(property.Value, options); - continue; - } - if (property.NameEquals("extendedLocation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = ManagedClusterIdentity.DeserializeManagedClusterIdentity(property.Value, options); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("powerState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - powerState = ContainerServicePowerState.DeserializeContainerServicePowerState(property0.Value, options); - continue; - } - if (property0.NameEquals("maxAgentPools"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxAgentPools = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("currentKubernetesVersion"u8)) - { - currentKubernetesVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("dnsPrefix"u8)) - { - dnsPrefix = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("fqdnSubdomain"u8)) - { - fqdnSubdomain = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("fqdn"u8)) - { - fqdn = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("privateFQDN"u8)) - { - privateFQDN = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("azurePortalFQDN"u8)) - { - azurePortalFQDN = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("agentPoolProfiles"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ManagedClusterAgentPoolProfile.DeserializeManagedClusterAgentPoolProfile(item, options)); - } - agentPoolProfiles = array; - continue; - } - if (property0.NameEquals("linuxProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - linuxProfile = ContainerServiceLinuxProfile.DeserializeContainerServiceLinuxProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("windowsProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - windowsProfile = ManagedClusterWindowsProfile.DeserializeManagedClusterWindowsProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("servicePrincipalProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - servicePrincipalProfile = ManagedClusterServicePrincipalProfile.DeserializeManagedClusterServicePrincipalProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("addonProfiles"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, ManagedClusterAddonProfile.DeserializeManagedClusterAddonProfile(property1.Value, options)); - } - addonProfiles = dictionary; - continue; - } - if (property0.NameEquals("podIdentityProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podIdentityProfile = ManagedClusterPodIdentityProfile.DeserializeManagedClusterPodIdentityProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("oidcIssuerProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - oidcIssuerProfile = ManagedClusterOidcIssuerProfile.DeserializeManagedClusterOidcIssuerProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("nodeResourceGroup"u8)) - { - nodeResourceGroup = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enableRBAC"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableRBAC = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("supportPlan"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - supportPlan = new KubernetesSupportPlan(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("enablePodSecurityPolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePodSecurityPolicy = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("networkProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = ContainerServiceNetworkProfile.DeserializeContainerServiceNetworkProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("aadProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - aadProfile = ManagedClusterAadProfile.DeserializeManagedClusterAadProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("autoUpgradeProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoUpgradeProfile = ManagedClusterAutoUpgradeProfile.DeserializeManagedClusterAutoUpgradeProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("upgradeSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeSettings = ClusterUpgradeSettings.DeserializeClusterUpgradeSettings(property0.Value, options); - continue; - } - if (property0.NameEquals("autoScalerProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoScalerProfile = ManagedClusterAutoScalerProfile.DeserializeManagedClusterAutoScalerProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("apiServerAccessProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - apiServerAccessProfile = ManagedClusterApiServerAccessProfile.DeserializeManagedClusterApiServerAccessProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("diskEncryptionSetID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diskEncryptionSetId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("identityProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, ContainerServiceUserAssignedIdentity.DeserializeContainerServiceUserAssignedIdentity(property1.Value, options)); - } - identityProfile = dictionary; - continue; - } - if (property0.NameEquals("privateLinkResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(item, options)); - } - privateLinkResources = array; - continue; - } - if (property0.NameEquals("disableLocalAccounts"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - disableLocalAccounts = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("httpProxyConfig"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - httpProxyConfig = ManagedClusterHttpProxyConfig.DeserializeManagedClusterHttpProxyConfig(property0.Value, options); - continue; - } - if (property0.NameEquals("securityProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - securityProfile = ManagedClusterSecurityProfile.DeserializeManagedClusterSecurityProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("storageProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - storageProfile = ManagedClusterStorageProfile.DeserializeManagedClusterStorageProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("publicNetworkAccess"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - publicNetworkAccess = new ContainerServicePublicNetworkAccess(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("workloadAutoScalerProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadAutoScalerProfile = ManagedClusterWorkloadAutoScalerProfile.DeserializeManagedClusterWorkloadAutoScalerProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("azureMonitorProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureMonitorProfile = ManagedClusterAzureMonitorProfile.DeserializeManagedClusterAzureMonitorProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("serviceMeshProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - serviceMeshProfile = ServiceMeshProfile.DeserializeServiceMeshProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("resourceUID"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceUID = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceManagedClusterData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - sku, - extendedLocation, - identity, - provisioningState, - powerState, - maxAgentPools, - kubernetesVersion, - currentKubernetesVersion, - dnsPrefix, - fqdnSubdomain, - fqdn, - privateFQDN, - azurePortalFQDN, - agentPoolProfiles ?? new ChangeTrackingList(), - linuxProfile, - windowsProfile, - servicePrincipalProfile, - addonProfiles ?? new ChangeTrackingDictionary(), - podIdentityProfile, - oidcIssuerProfile, - nodeResourceGroup, - enableRBAC, - supportPlan, - enablePodSecurityPolicy, - networkProfile, - aadProfile, - autoUpgradeProfile, - upgradeSettings, - autoScalerProfile, - apiServerAccessProfile, - diskEncryptionSetId, - identityProfile ?? new ChangeTrackingDictionary(), - privateLinkResources ?? new ChangeTrackingList(), - disableLocalAccounts, - httpProxyConfig, - securityProfile, - storageProfile, - publicNetworkAccess, - workloadAutoScalerProfile, - azureMonitorProfile, - serviceMeshProfile, - resourceUID, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceManagedClusterData)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceManagedClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceManagedClusterData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceManagedClusterData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs deleted file mode 100644 index 2d5de45be238..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServiceManagedCluster data model. - /// Managed cluster. - /// - public partial class ContainerServiceManagedClusterData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public ContainerServiceManagedClusterData(AzureLocation location) : base(location) - { - AgentPoolProfiles = new ChangeTrackingList(); - AddonProfiles = new ChangeTrackingDictionary(); - IdentityProfile = new ChangeTrackingDictionary(); - PrivateLinkResources = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The managed cluster SKU. - /// The extended location of the Virtual Machine. - /// The identity of the managed cluster, if configured. - /// The current provisioning state. - /// The Power State of the cluster. - /// The max number of agent pools for the managed cluster. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. - /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// This cannot be updated once the Managed Cluster has been created. - /// This cannot be updated once the Managed Cluster has been created. - /// The FQDN of the master pool. - /// The FQDN of private cluster. - /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. - /// The agent pool properties. - /// The profile for Linux VMs in the Managed Cluster. - /// The profile for Windows VMs in the Managed Cluster. - /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. - /// The profile of managed cluster add-on. - /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. - /// The OIDC issuer profile of the Managed Cluster. - /// The name of the resource group containing agent pool nodes. - /// Whether to enable Kubernetes Role-Based Access Control. - /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. - /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. - /// The network configuration profile. - /// The Azure Active Directory configuration. - /// The auto upgrade configuration. - /// Settings for upgrading a cluster. - /// Parameters to be applied to the cluster-autoscaler when enabled. - /// The access profile for managed cluster API server. - /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - /// Identities associated with the cluster. - /// Private link resources associated with the cluster. - /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). - /// Configurations for provisioning the cluster with HTTP proxy servers. - /// Security profile for the managed cluster. - /// Storage profile for the managed cluster. - /// Allow or deny public network access for AKS. - /// Workload Auto-scaler profile for the managed cluster. - /// Azure Monitor addon profiles for monitoring the managed cluster. - /// Service mesh profile for a managed cluster. - /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). - /// Keeps track of any properties unknown to the library. - internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedClusterSku sku, ExtendedLocation extendedLocation, ManagedClusterIdentity clusterIdentity, string provisioningState, ContainerServicePowerState powerState, int? maxAgentPools, string kubernetesVersion, string currentKubernetesVersion, string dnsPrefix, string fqdnSubdomain, string fqdn, string privateFqdn, string azurePortalFqdn, IList agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, ManagedClusterWindowsProfile windowsProfile, ManagedClusterServicePrincipalProfile servicePrincipalProfile, IDictionary addonProfiles, ManagedClusterPodIdentityProfile podIdentityProfile, ManagedClusterOidcIssuerProfile oidcIssuerProfile, string nodeResourceGroup, bool? enableRbac, KubernetesSupportPlan? supportPlan, bool? enablePodSecurityPolicy, ContainerServiceNetworkProfile networkProfile, ManagedClusterAadProfile aadProfile, ManagedClusterAutoUpgradeProfile autoUpgradeProfile, ClusterUpgradeSettings upgradeSettings, ManagedClusterAutoScalerProfile autoScalerProfile, ManagedClusterApiServerAccessProfile apiServerAccessProfile, ResourceIdentifier diskEncryptionSetId, IDictionary identityProfile, IList privateLinkResources, bool? disableLocalAccounts, ManagedClusterHttpProxyConfig httpProxyConfig, ManagedClusterSecurityProfile securityProfile, ManagedClusterStorageProfile storageProfile, ContainerServicePublicNetworkAccess? publicNetworkAccess, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile, ManagedClusterAzureMonitorProfile azureMonitorProfile, ServiceMeshProfile serviceMeshProfile, ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Sku = sku; - ExtendedLocation = extendedLocation; - ClusterIdentity = clusterIdentity; - ProvisioningState = provisioningState; - PowerState = powerState; - MaxAgentPools = maxAgentPools; - KubernetesVersion = kubernetesVersion; - CurrentKubernetesVersion = currentKubernetesVersion; - DnsPrefix = dnsPrefix; - FqdnSubdomain = fqdnSubdomain; - Fqdn = fqdn; - PrivateFqdn = privateFqdn; - AzurePortalFqdn = azurePortalFqdn; - AgentPoolProfiles = agentPoolProfiles; - LinuxProfile = linuxProfile; - WindowsProfile = windowsProfile; - ServicePrincipalProfile = servicePrincipalProfile; - AddonProfiles = addonProfiles; - PodIdentityProfile = podIdentityProfile; - OidcIssuerProfile = oidcIssuerProfile; - NodeResourceGroup = nodeResourceGroup; - EnableRbac = enableRbac; - SupportPlan = supportPlan; - EnablePodSecurityPolicy = enablePodSecurityPolicy; - NetworkProfile = networkProfile; - AadProfile = aadProfile; - AutoUpgradeProfile = autoUpgradeProfile; - UpgradeSettings = upgradeSettings; - AutoScalerProfile = autoScalerProfile; - ApiServerAccessProfile = apiServerAccessProfile; - DiskEncryptionSetId = diskEncryptionSetId; - IdentityProfile = identityProfile; - PrivateLinkResources = privateLinkResources; - DisableLocalAccounts = disableLocalAccounts; - HttpProxyConfig = httpProxyConfig; - SecurityProfile = securityProfile; - StorageProfile = storageProfile; - PublicNetworkAccess = publicNetworkAccess; - WorkloadAutoScalerProfile = workloadAutoScalerProfile; - AzureMonitorProfile = azureMonitorProfile; - ServiceMeshProfile = serviceMeshProfile; - ResourceId = resourceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceManagedClusterData() - { - } - - /// The managed cluster SKU. - public ManagedClusterSku Sku { get; set; } - /// The extended location of the Virtual Machine. - public ExtendedLocation ExtendedLocation { get; set; } - /// The identity of the managed cluster, if configured. - public ManagedClusterIdentity ClusterIdentity { get; set; } - /// The current provisioning state. - public string ProvisioningState { get; } - /// The Power State of the cluster. - internal ContainerServicePowerState PowerState { get; } - /// Tells whether the cluster is Running or Stopped. - public ContainerServiceStateCode? PowerStateCode - { - get => PowerState?.Code; - } - - /// The max number of agent pools for the managed cluster. - public int? MaxAgentPools { get; } - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. - public string KubernetesVersion { get; set; } - /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used. - public string CurrentKubernetesVersion { get; } - /// This cannot be updated once the Managed Cluster has been created. - public string DnsPrefix { get; set; } - /// This cannot be updated once the Managed Cluster has been created. - public string FqdnSubdomain { get; set; } - /// The FQDN of the master pool. - public string Fqdn { get; } - /// The FQDN of private cluster. - public string PrivateFqdn { get; } - /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. - public string AzurePortalFqdn { get; } - /// The agent pool properties. - public IList AgentPoolProfiles { get; } - /// The profile for Linux VMs in the Managed Cluster. - public ContainerServiceLinuxProfile LinuxProfile { get; set; } - /// The profile for Windows VMs in the Managed Cluster. - public ManagedClusterWindowsProfile WindowsProfile { get; set; } - /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. - public ManagedClusterServicePrincipalProfile ServicePrincipalProfile { get; set; } - /// The profile of managed cluster add-on. - public IDictionary AddonProfiles { get; } - /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. - public ManagedClusterPodIdentityProfile PodIdentityProfile { get; set; } - /// The OIDC issuer profile of the Managed Cluster. - public ManagedClusterOidcIssuerProfile OidcIssuerProfile { get; set; } - /// The name of the resource group containing agent pool nodes. - public string NodeResourceGroup { get; set; } - /// Whether to enable Kubernetes Role-Based Access Control. - public bool? EnableRbac { get; set; } - /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. - public KubernetesSupportPlan? SupportPlan { get; set; } - /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. - public bool? EnablePodSecurityPolicy { get; set; } - /// The network configuration profile. - public ContainerServiceNetworkProfile NetworkProfile { get; set; } - /// The Azure Active Directory configuration. - public ManagedClusterAadProfile AadProfile { get; set; } - /// The auto upgrade configuration. - public ManagedClusterAutoUpgradeProfile AutoUpgradeProfile { get; set; } - /// Settings for upgrading a cluster. - internal ClusterUpgradeSettings UpgradeSettings { get; set; } - /// Settings for overrides. - public UpgradeOverrideSettings UpgradeOverrideSettings - { - get => UpgradeSettings is null ? default : UpgradeSettings.OverrideSettings; - set - { - if (UpgradeSettings is null) - UpgradeSettings = new ClusterUpgradeSettings(); - UpgradeSettings.OverrideSettings = value; - } - } - - /// Parameters to be applied to the cluster-autoscaler when enabled. - public ManagedClusterAutoScalerProfile AutoScalerProfile { get; set; } - /// The access profile for managed cluster API server. - public ManagedClusterApiServerAccessProfile ApiServerAccessProfile { get; set; } - /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - public ResourceIdentifier DiskEncryptionSetId { get; set; } - /// Identities associated with the cluster. - public IDictionary IdentityProfile { get; } - /// Private link resources associated with the cluster. - public IList PrivateLinkResources { get; } - /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). - public bool? DisableLocalAccounts { get; set; } - /// Configurations for provisioning the cluster with HTTP proxy servers. - public ManagedClusterHttpProxyConfig HttpProxyConfig { get; set; } - /// Security profile for the managed cluster. - public ManagedClusterSecurityProfile SecurityProfile { get; set; } - /// Storage profile for the managed cluster. - public ManagedClusterStorageProfile StorageProfile { get; set; } - /// Allow or deny public network access for AKS. - public ContainerServicePublicNetworkAccess? PublicNetworkAccess { get; set; } - /// Workload Auto-scaler profile for the managed cluster. - public ManagedClusterWorkloadAutoScalerProfile WorkloadAutoScalerProfile { get; set; } - /// Azure Monitor addon profiles for monitoring the managed cluster. - internal ManagedClusterAzureMonitorProfile AzureMonitorProfile { get; set; } - /// Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. - public ManagedClusterMonitorProfileMetrics AzureMonitorMetrics - { - get => AzureMonitorProfile is null ? default : AzureMonitorProfile.Metrics; - set - { - if (AzureMonitorProfile is null) - AzureMonitorProfile = new ManagedClusterAzureMonitorProfile(); - AzureMonitorProfile.Metrics = value; - } - } - - /// Service mesh profile for a managed cluster. - public ServiceMeshProfile ServiceMeshProfile { get; set; } - /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). - public ResourceIdentifier ResourceId { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.Serialization.cs deleted file mode 100644 index f6bdecf803e9..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ContainerServiceManagedClusterResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ContainerServiceManagedClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ContainerServiceManagedClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs deleted file mode 100644 index e9761b7a74dd..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs +++ /dev/null @@ -1,2330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a ContainerServiceManagedCluster along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetContainerServiceManagedClusterResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServiceManagedCluster method. - /// - public partial class ContainerServiceManagedClusterResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _containerServiceManagedClusterManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _containerServiceManagedClusterManagedClustersRestClient; - private readonly ClientDiagnostics _agentPoolsClientDiagnostics; - private readonly AgentPoolsRestOperations _agentPoolsRestClient; - private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; - private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; - private readonly ClientDiagnostics _resolvePrivateLinkServiceIdClientDiagnostics; - private readonly ResolvePrivateLinkServiceIdRestOperations _resolvePrivateLinkServiceIdRestClient; - private readonly ContainerServiceManagedClusterData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters"; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceManagedClusterResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ContainerServiceManagedClusterResource(ArmClient client, ContainerServiceManagedClusterData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ContainerServiceManagedClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceManagedClusterManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServiceManagedClusterManagedClustersApiVersion); - _containerServiceManagedClusterManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceManagedClusterManagedClustersApiVersion); - _agentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _agentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _resolvePrivateLinkServiceIdClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _resolvePrivateLinkServiceIdRestClient = new ResolvePrivateLinkServiceIdRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual ContainerServiceManagedClusterData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets an object representing a ManagedClusterUpgradeProfileResource along with the instance operations that can be performed on it in the ContainerServiceManagedCluster. - /// Returns a object. - public virtual ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProfile() - { - return new ManagedClusterUpgradeProfileResource(Client, Id.AppendChildResource("upgradeProfiles", "default")); - } - - /// Gets a collection of MeshUpgradeProfileResources in the ContainerServiceManagedCluster. - /// An object representing collection of MeshUpgradeProfileResources and their operations over a MeshUpgradeProfileResource. - public virtual MeshUpgradeProfileCollection GetMeshUpgradeProfiles() - { - return GetCachedClient(client => new MeshUpgradeProfileCollection(client, Id)); - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetMeshUpgradeProfileAsync(string mode, CancellationToken cancellationToken = default) - { - return await GetMeshUpgradeProfiles().GetAsync(mode, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetMeshUpgradeProfile(string mode, CancellationToken cancellationToken = default) - { - return GetMeshUpgradeProfiles().Get(mode, cancellationToken); - } - - /// Gets a collection of ContainerServiceMaintenanceConfigurationResources in the ContainerServiceManagedCluster. - /// An object representing collection of ContainerServiceMaintenanceConfigurationResources and their operations over a ContainerServiceMaintenanceConfigurationResource. - public virtual ContainerServiceMaintenanceConfigurationCollection GetContainerServiceMaintenanceConfigurations() - { - return GetCachedClient(client => new ContainerServiceMaintenanceConfigurationCollection(client, Id)); - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetContainerServiceMaintenanceConfigurationAsync(string configName, CancellationToken cancellationToken = default) - { - return await GetContainerServiceMaintenanceConfigurations().GetAsync(configName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the specified maintenance configuration of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName} - /// - /// - /// Operation Id - /// MaintenanceConfigurations_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetContainerServiceMaintenanceConfiguration(string configName, CancellationToken cancellationToken = default) - { - return GetContainerServiceMaintenanceConfigurations().Get(configName, cancellationToken); - } - - /// Gets a collection of ContainerServiceAgentPoolResources in the ContainerServiceManagedCluster. - /// An object representing collection of ContainerServiceAgentPoolResources and their operations over a ContainerServiceAgentPoolResource. - public virtual ContainerServiceAgentPoolCollection GetContainerServiceAgentPools() - { - return GetCachedClient(client => new ContainerServiceAgentPoolCollection(client, Id)); - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetContainerServiceAgentPoolAsync(string agentPoolName, CancellationToken cancellationToken = default) - { - return await GetContainerServiceAgentPools().GetAsync(agentPoolName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the specified managed cluster agent pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} - /// - /// - /// Operation Id - /// AgentPools_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the agent pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetContainerServiceAgentPool(string agentPoolName, CancellationToken cancellationToken = default) - { - return GetContainerServiceAgentPools().Get(agentPoolName, cancellationToken); - } - - /// Gets a collection of ContainerServicePrivateEndpointConnectionResources in the ContainerServiceManagedCluster. - /// An object representing collection of ContainerServicePrivateEndpointConnectionResources and their operations over a ContainerServicePrivateEndpointConnectionResource. - public virtual ContainerServicePrivateEndpointConnectionCollection GetContainerServicePrivateEndpointConnections() - { - return GetCachedClient(client => new ContainerServicePrivateEndpointConnectionCollection(client, Id)); - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetContainerServicePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - return await GetContainerServicePrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetContainerServicePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - return GetContainerServicePrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); - } - - /// Gets a collection of ContainerServiceTrustedAccessRoleBindingResources in the ContainerServiceManagedCluster. - /// An object representing collection of ContainerServiceTrustedAccessRoleBindingResources and their operations over a ContainerServiceTrustedAccessRoleBindingResource. - public virtual ContainerServiceTrustedAccessRoleBindingCollection GetContainerServiceTrustedAccessRoleBindings() - { - return GetCachedClient(client => new ContainerServiceTrustedAccessRoleBindingCollection(client, Id)); - } - - /// - /// Get a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetContainerServiceTrustedAccessRoleBindingAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - return await GetContainerServiceTrustedAccessRoleBindings().GetAsync(trustedAccessRoleBindingName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetContainerServiceTrustedAccessRoleBinding(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - return GetContainerServiceTrustedAccessRoleBindings().Get(trustedAccessRoleBindingName, cancellationToken); - } - - /// - /// Gets a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Get"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Get"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates tags on a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_UpdateTags - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Parameters supplied to the Update Managed Cluster Tags operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Update"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates tags on a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_UpdateTags - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Parameters supplied to the Update Managed Cluster Tags operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Update"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential - /// - /// - /// Operation Id - /// ManagedClusters_GetAccessProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The name of the role for managed cluster accessProfile resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAccessProfileAsync(string roleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleName, nameof(roleName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetAccessProfile"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAccessProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential - /// - /// - /// Operation Id - /// ManagedClusters_GetAccessProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The name of the role for managed cluster accessProfile resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetAccessProfile(string roleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleName, nameof(roleName)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetAccessProfile"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.GetAccessProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the admin credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterAdminCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - public virtual async Task> GetClusterAdminCredentialsAsync(string serverFqdn = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterAdminCredentials"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ListClusterAdminCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the admin credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterAdminCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - public virtual Response GetClusterAdminCredentials(string serverFqdn = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterAdminCredentials"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ListClusterAdminCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the user credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterUserCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. - /// The cancellation token to use. - public virtual async Task> GetClusterUserCredentialsAsync(string serverFqdn = null, KubeConfigFormat? format = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterUserCredentials"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ListClusterUserCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, format, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the user credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterUserCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. - /// The cancellation token to use. - public virtual Response GetClusterUserCredentials(string serverFqdn = null, KubeConfigFormat? format = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterUserCredentials"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ListClusterUserCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, format, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the cluster monitoring user credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterMonitoringUserCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - public virtual async Task> GetClusterMonitoringUserCredentialsAsync(string serverFqdn = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterMonitoringUserCredentials"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ListClusterMonitoringUserCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the cluster monitoring user credentials of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential - /// - /// - /// Operation Id - /// ManagedClusters_ListClusterMonitoringUserCredentials - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - public virtual Response GetClusterMonitoringUserCredentials(string serverFqdn = null, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetClusterMonitoringUserCredentials"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ListClusterMonitoringUserCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverFqdn, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This action cannot be performed on a cluster that is not using a service principal - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile - /// - /// - /// Operation Id - /// ManagedClusters_ResetServicePrincipalProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The service principal profile to set on the managed cluster. - /// The cancellation token to use. - /// is null. - public virtual async Task ResetServicePrincipalProfileAsync(WaitUntil waitUntil, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(managedClusterServicePrincipalProfile, nameof(managedClusterServicePrincipalProfile)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResetServicePrincipalProfile"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ResetServicePrincipalProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterServicePrincipalProfile, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateResetServicePrincipalProfileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterServicePrincipalProfile).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This action cannot be performed on a cluster that is not using a service principal - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile - /// - /// - /// Operation Id - /// ManagedClusters_ResetServicePrincipalProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The service principal profile to set on the managed cluster. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation ResetServicePrincipalProfile(WaitUntil waitUntil, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(managedClusterServicePrincipalProfile, nameof(managedClusterServicePrincipalProfile)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResetServicePrincipalProfile"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ResetServicePrincipalProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterServicePrincipalProfile, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateResetServicePrincipalProfileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterServicePrincipalProfile).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile - /// - /// - /// Operation Id - /// ManagedClusters_ResetAadProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The AAD profile to set on the Managed Cluster. - /// The cancellation token to use. - /// is null. - public virtual async Task ResetAadProfileAsync(WaitUntil waitUntil, ManagedClusterAadProfile managedClusterAadProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(managedClusterAadProfile, nameof(managedClusterAadProfile)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResetAadProfile"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.ResetAadProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterAadProfile, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateResetAadProfileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterAadProfile).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile - /// - /// - /// Operation Id - /// ManagedClusters_ResetAadProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The AAD profile to set on the Managed Cluster. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation ResetAadProfile(WaitUntil waitUntil, ManagedClusterAadProfile managedClusterAadProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(managedClusterAadProfile, nameof(managedClusterAadProfile)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResetAadProfile"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.ResetAadProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterAadProfile, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateResetAadProfileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, managedClusterAadProfile).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates - /// - /// - /// Operation Id - /// ManagedClusters_RotateClusterCertificates - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task RotateClusterCertificatesAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RotateClusterCertificates"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.RotateClusterCertificatesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRotateClusterCertificatesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates - /// - /// - /// Operation Id - /// ManagedClusters_RotateClusterCertificates - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation RotateClusterCertificates(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RotateClusterCertificates"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.RotateClusterCertificates(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRotateClusterCertificatesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort - /// - /// - /// Operation Id - /// ManagedClusters_AbortLatestOperation - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task AbortLatestOperationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.AbortLatestOperation"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.AbortLatestOperationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort - /// - /// - /// Operation Id - /// ManagedClusters_AbortLatestOperation - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.AbortLatestOperation"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.AbortLatestOperation(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Rotates the service account signing keys of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys - /// - /// - /// Operation Id - /// ManagedClusters_RotateServiceAccountSigningKeys - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task RotateServiceAccountSigningKeysAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RotateServiceAccountSigningKeys"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.RotateServiceAccountSigningKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRotateServiceAccountSigningKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Rotates the service account signing keys of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys - /// - /// - /// Operation Id - /// ManagedClusters_RotateServiceAccountSigningKeys - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation RotateServiceAccountSigningKeys(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RotateServiceAccountSigningKeys"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.RotateServiceAccountSigningKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRotateServiceAccountSigningKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop - /// - /// - /// Operation Id - /// ManagedClusters_Stop - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task StopAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Stop"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop - /// - /// - /// Operation Id - /// ManagedClusters_Stop - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Stop(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Stop"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start - /// - /// - /// Operation Id - /// ManagedClusters_Start - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task StartAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Start"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start - /// - /// - /// Operation Id - /// ManagedClusters_Start - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Start"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand - /// - /// - /// Operation Id - /// ManagedClusters_RunCommand - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The run command request. - /// The cancellation token to use. - /// is null. - public virtual async Task> RunCommandAsync(WaitUntil waitUntil, ManagedClusterRunCommandContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RunCommand"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.RunCommandAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ManagedClusterRunCommandResultOperationSource(), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRunCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand - /// - /// - /// Operation Id - /// ManagedClusters_RunCommand - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The run command request. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation RunCommand(WaitUntil waitUntil, ManagedClusterRunCommandContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RunCommand"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.RunCommand(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ContainerServiceArmOperation(new ManagedClusterRunCommandResultOperationSource(), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateRunCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the results of a command which has been run on the Managed Cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId} - /// - /// - /// Operation Id - /// ManagedClusters_GetCommandResult - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Id of the command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetCommandResultAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetCommandResult"); - scope.Start(); - try - { - var response = await _containerServiceManagedClusterManagedClustersRestClient.GetCommandResultAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the results of a command which has been run on the Managed Cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId} - /// - /// - /// Operation Id - /// ManagedClusters_GetCommandResult - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Id of the command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetCommandResult(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetCommandResult"); - scope.Start(); - try - { - var response = _containerServiceManagedClusterManagedClustersRestClient.GetCommandResult(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints - /// - /// - /// Operation Id - /// ManagedClusters_ListOutboundNetworkDependenciesEndpoints - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetOutboundNetworkDependenciesEndpointsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceManagedClusterManagedClustersRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ContainerServiceOutboundEnvironmentEndpoint.DeserializeContainerServiceOutboundEnvironmentEndpoint(e), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterResource.GetOutboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints - /// - /// - /// Operation Id - /// ManagedClusters_ListOutboundNetworkDependenciesEndpoints - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetOutboundNetworkDependenciesEndpoints(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceManagedClusterManagedClustersRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ContainerServiceOutboundEnvironmentEndpoint.DeserializeContainerServiceOutboundEnvironmentEndpoint(e), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterResource.GetOutboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); - } - - /// - /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions - /// - /// - /// Operation Id - /// AgentPools_GetAvailableAgentPoolVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAvailableAgentPoolVersionsAsync(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolsClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetAvailableAgentPoolVersions"); - scope.Start(); - try - { - var response = await _agentPoolsRestClient.GetAvailableAgentPoolVersionsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions - /// - /// - /// Operation Id - /// AgentPools_GetAvailableAgentPoolVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetAvailableAgentPoolVersions(CancellationToken cancellationToken = default) - { - using var scope = _agentPoolsClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.GetAvailableAgentPoolVersions"); - scope.Start(); - try - { - var response = _agentPoolsRestClient.GetAvailableAgentPoolVersions(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources - /// - /// - /// Operation Id - /// PrivateLinkResources_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetPrivateLinkResourcesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(e), _privateLinkResourcesClientDiagnostics, Pipeline, "ContainerServiceManagedClusterResource.GetPrivateLinkResources", "value", null, cancellationToken); - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources - /// - /// - /// Operation Id - /// PrivateLinkResources_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetPrivateLinkResources(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(e), _privateLinkResourcesClientDiagnostics, Pipeline, "ContainerServiceManagedClusterResource.GetPrivateLinkResources", "value", null, cancellationToken); - } - - /// - /// Gets the private link service ID for the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId - /// - /// - /// Operation Id - /// ResolvePrivateLinkServiceId_Post - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Parameters required in order to resolve a private link service ID. - /// The cancellation token to use. - /// is null. - public virtual async Task> ResolvePrivateLinkServiceIdAsync(ContainerServicePrivateLinkResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _resolvePrivateLinkServiceIdClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResolvePrivateLinkServiceId"); - scope.Start(); - try - { - var response = await _resolvePrivateLinkServiceIdRestClient.PostAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the private link service ID for the specified managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId - /// - /// - /// Operation Id - /// ResolvePrivateLinkServiceId_Post - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Parameters required in order to resolve a private link service ID. - /// The cancellation token to use. - /// is null. - public virtual Response ResolvePrivateLinkServiceId(ContainerServicePrivateLinkResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _resolvePrivateLinkServiceIdClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.ResolvePrivateLinkServiceId"); - scope.Start(); - try - { - var response = _resolvePrivateLinkServiceIdRestClient.Post(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} - /// - /// - /// Operation Id - /// ManagedClusters_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceManagedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs deleted file mode 100644 index e42d1a48311f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetContainerServicePrivateEndpointConnections method from an instance of . - /// - public partial class ContainerServicePrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; - private readonly PrivateEndpointConnectionsRestOperations _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServicePrivateEndpointConnectionCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal ContainerServicePrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServicePrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServicePrivateEndpointConnectionResource.ResourceType, out string containerServicePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); - _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServicePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Updates a private endpoint connection. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Update - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the private endpoint connection. - /// The updated private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); - var uri = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a private endpoint connection. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Update - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the private endpoint connection. - /// The updated private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); - var uri = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.Get"); - scope.Start(); - try - { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.Get"); - scope.Start(); - try - { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections - /// - /// - /// Operation Id - /// PrivateEndpointConnections_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ContainerServicePrivateEndpointConnectionResource(Client, ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(e)), _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ContainerServicePrivateEndpointConnectionCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections - /// - /// - /// Operation Id - /// PrivateEndpointConnections_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new ContainerServicePrivateEndpointConnectionResource(Client, ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(e)), _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ContainerServicePrivateEndpointConnectionCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.Exists"); - scope.Start(); - try - { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnections_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.cs deleted file mode 100644 index 0ad96e21b692..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServicePrivateEndpointConnection data model. - /// A private endpoint connection - /// - public partial class ContainerServicePrivateEndpointConnectionData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ContainerServicePrivateEndpointConnectionData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The current provisioning state. - /// The resource of private endpoint. - /// A collection of information about the state of the connection between service consumer and provider. - /// Keeps track of any properties unknown to the library. - internal ContainerServicePrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerServicePrivateEndpointConnectionProvisioningState? provisioningState, WritableSubResource privateEndpoint, ContainerServicePrivateLinkServiceConnectionState connectionState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - PrivateEndpoint = privateEndpoint; - ConnectionState = connectionState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The current provisioning state. - public ContainerServicePrivateEndpointConnectionProvisioningState? ProvisioningState { get; } - /// The resource of private endpoint. - internal WritableSubResource PrivateEndpoint { get; set; } - /// Gets or sets Id. - public ResourceIdentifier PrivateEndpointId - { - get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; - set - { - if (PrivateEndpoint is null) - PrivateEndpoint = new WritableSubResource(); - PrivateEndpoint.Id = value; - } - } - - /// A collection of information about the state of the connection between service consumer and provider. - public ContainerServicePrivateLinkServiceConnectionState ConnectionState { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.Serialization.cs deleted file mode 100644 index d5486963c65b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ContainerServicePrivateEndpointConnectionResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ContainerServicePrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ContainerServicePrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs deleted file mode 100644 index 53b1a5b4fea4..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetContainerServiceTrustedAccessRoleBindings method from an instance of . - /// - public partial class ContainerServiceTrustedAccessRoleBindingCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics; - private readonly TrustedAccessRoleBindingsRestOperations _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerServiceTrustedAccessRoleBindingCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal ContainerServiceTrustedAccessRoleBindingCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceTrustedAccessRoleBindingResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerServiceTrustedAccessRoleBindingResource.ResourceType, out string containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsApiVersion); - _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient = new TrustedAccessRoleBindingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Create or update a trusted access role binding - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of trusted access role binding. - /// A trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceTrustedAccessRoleBindingOperationSource(Client), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update a trusted access role binding - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of trusted access role binding. - /// A trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceTrustedAccessRoleBindingOperationSource(Client), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.Get"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a trusted access role binding. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.Get"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List trusted access role bindings. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceTrustedAccessRoleBindingResource(Client, ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(e)), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, "ContainerServiceTrustedAccessRoleBindingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List trusted access role bindings. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceTrustedAccessRoleBindingResource(Client, ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(e)), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, "ContainerServiceTrustedAccessRoleBindingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.Exists"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.Exists"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} - /// - /// - /// Operation Id - /// TrustedAccessRoleBindings_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of trusted access role binding. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); - - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingCollection.GetIfExists"); - scope.Start(); - try - { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, trustedAccessRoleBindingName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.cs deleted file mode 100644 index 5405d11d531f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ContainerServiceTrustedAccessRoleBinding data model. - /// Defines binding between a resource and role - /// - public partial class ContainerServiceTrustedAccessRoleBindingData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The ARM resource ID of source resource that trusted access is configured for. - /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. - /// or is null. - public ContainerServiceTrustedAccessRoleBindingData(ResourceIdentifier sourceResourceId, IEnumerable roles) - { - Argument.AssertNotNull(sourceResourceId, nameof(sourceResourceId)); - Argument.AssertNotNull(roles, nameof(roles)); - - SourceResourceId = sourceResourceId; - Roles = roles.ToList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The current provisioning state of trusted access role binding. - /// The ARM resource ID of source resource that trusted access is configured for. - /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceTrustedAccessRoleBindingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerServiceTrustedAccessRoleBindingProvisioningState? provisioningState, ResourceIdentifier sourceResourceId, IList roles, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - SourceResourceId = sourceResourceId; - Roles = roles; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceTrustedAccessRoleBindingData() - { - } - - /// The current provisioning state of trusted access role binding. - public ContainerServiceTrustedAccessRoleBindingProvisioningState? ProvisioningState { get; } - /// The ARM resource ID of source resource that trusted access is configured for. - public ResourceIdentifier SourceResourceId { get; set; } - /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. - public IList Roles { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.Serialization.cs deleted file mode 100644 index 6215413fdc3f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ContainerServiceTrustedAccessRoleBindingResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ContainerServiceTrustedAccessRoleBindingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ContainerServiceTrustedAccessRoleBindingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs index 9d4c114d8c6b..545a9657619d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.ResourceManager.ContainerService.Mocking; -using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ContainerService @@ -34,768 +33,244 @@ private static MockableContainerServiceSubscriptionResource GetMockableContainer } /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static OSOptionProfileResource GetOSOptionProfileResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static FleetResource GetFleetResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerServiceArmClient(client).GetOSOptionProfileResource(id); + return GetMockableContainerServiceArmClient(client).GetFleetResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static FleetMemberResource GetFleetMemberResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerServiceArmClient(client).GetManagedClusterUpgradeProfileResource(id); + return GetMockableContainerServiceArmClient(client).GetFleetMemberResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ContainerServiceManagedClusterResource GetContainerServiceManagedClusterResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static UpdateRunResource GetUpdateRunResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerServiceArmClient(client).GetContainerServiceManagedClusterResource(id); + return GetMockableContainerServiceArmClient(client).GetUpdateRunResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static MeshRevisionProfileResource GetMeshRevisionProfileResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static FleetUpdateStrategyResource GetFleetUpdateStrategyResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerServiceArmClient(client).GetMeshRevisionProfileResource(id); + return GetMockableContainerServiceArmClient(client).GetFleetUpdateStrategyResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of FleetResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static MeshUpgradeProfileResource GetMeshUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetMeshUpgradeProfileResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static ContainerServiceMaintenanceConfigurationResource GetContainerServiceMaintenanceConfigurationResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetContainerServiceMaintenanceConfigurationResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static ContainerServiceAgentPoolResource GetContainerServiceAgentPoolResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetContainerServiceAgentPoolResource(id); - } - - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetAgentPoolUpgradeProfileResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static ContainerServicePrivateEndpointConnectionResource GetContainerServicePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetContainerServicePrivateEndpointConnectionResource(id); - } - - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static AgentPoolSnapshotResource GetAgentPoolSnapshotResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetAgentPoolSnapshotResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static ContainerServiceTrustedAccessRoleBindingResource GetContainerServiceTrustedAccessRoleBindingResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetContainerServiceTrustedAccessRoleBindingResource(id); - } - - /// - /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of ContainerServiceManagedClusterResources and their operations over a ContainerServiceManagedClusterResource. - public static ContainerServiceManagedClusterCollection GetContainerServiceManagedClusters(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of FleetResources and their operations over a FleetResource. + public static FleetCollection GetFleets(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetContainerServiceManagedClusters(); + return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetFleets(); } /// - /// Gets a managed cluster. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// ManagedClusters_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetContainerServiceManagedClusterAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) + public static async Task> GetFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetContainerServiceManagedClusterAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a managed cluster. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// ManagedClusters_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetContainerServiceManagedCluster(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) + public static Response GetFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetContainerServiceManagedCluster(resourceName, cancellationToken); + return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetFleet(fleetName, cancellationToken); } /// - /// Gets a collection of AgentPoolSnapshotResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// is null. - /// An object representing collection of AgentPoolSnapshotResources and their operations over a AgentPoolSnapshotResource. - public static AgentPoolSnapshotCollection GetAgentPoolSnapshots(this ResourceGroupResource resourceGroupResource) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetAgentPoolSnapshots(); - } - - /// - /// Gets a snapshot. + /// Lists fleets in the specified subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// Snapshots_Get + /// Fleets_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetAgentPoolSnapshotAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetAgentPoolSnapshotAsync(resourceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetAgentPoolSnapshot(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableContainerServiceResourceGroupResource(resourceGroupResource).GetAgentPoolSnapshot(resourceName, cancellationToken); - } - - /// - /// Gets a collection of MeshRevisionProfileResources in the SubscriptionResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// is null. - /// An object representing collection of MeshRevisionProfileResources and their operations over a MeshRevisionProfileResource. - public static MeshRevisionProfileCollection GetMeshRevisionProfiles(this SubscriptionResource subscriptionResource, AzureLocation location) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetMeshRevisionProfiles(location); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetMeshRevisionProfileAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return await GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetMeshRevisionProfileAsync(location, mode, cancellationToken).ConfigureAwait(false); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetMeshRevisionProfile(this SubscriptionResource subscriptionResource, AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetMeshRevisionProfile(location, mode, cancellationToken); - } - - /// - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions - /// - /// - /// Operation Id - /// ManagedClusters_ListKubernetesVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - public static async Task> GetKubernetesVersionsManagedClusterAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return await GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetKubernetesVersionsManagedClusterAsync(location, cancellationToken).ConfigureAwait(false); - } - - /// - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions - /// - /// - /// Operation Id - /// ManagedClusters_ListKubernetesVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - public static Response GetKubernetesVersionsManagedCluster(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetKubernetesVersionsManagedCluster(location, cancellationToken); - } - - /// - /// Gets a list of managed clusters in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetContainerServiceManagedClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetContainerServiceManagedClustersAsync(cancellationToken); - } - - /// - /// Gets a list of managed clusters in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetContainerServiceManagedClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetFleetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetContainerServiceManagedClusters(cancellationToken); + return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetFleetsAsync(cancellationToken); } /// - /// Gets a list of snapshots in the specified subscription. + /// Lists fleets in the specified subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// Snapshots_List + /// Fleets_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetAgentPoolSnapshotsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetAgentPoolSnapshotsAsync(cancellationToken); - } - - /// - /// Gets a list of snapshots in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots - /// - /// - /// Operation Id - /// Snapshots_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetAgentPoolSnapshots(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetAgentPoolSnapshots(cancellationToken); - } - - /// - /// List supported trusted access roles. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles - /// - /// - /// Operation Id - /// TrustedAccessRoles_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetTrustedAccessRolesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetTrustedAccessRolesAsync(location, cancellationToken); - } - - /// - /// List supported trusted access roles. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles - /// - /// - /// Operation Id - /// TrustedAccessRoles_List - /// - /// - /// Default Api Version - /// 2023-10-01 + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the Azure region. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetTrustedAccessRoles(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetFleets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetTrustedAccessRoles(location, cancellationToken); + return GetMockableContainerServiceSubscriptionResource(subscriptionResource).GetFleets(cancellationToken); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs index 480506346597..61911cd1a9b9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs @@ -35,135 +35,51 @@ private string GetApiVersionOrNull(ResourceType resourceType) } /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual OSOptionProfileResource GetOSOptionProfileResource(ResourceIdentifier id) + /// Returns a object. + public virtual FleetResource GetFleetResource(ResourceIdentifier id) { - OSOptionProfileResource.ValidateResourceId(id); - return new OSOptionProfileResource(Client, id); + FleetResource.ValidateResourceId(id); + return new FleetResource(Client, id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProfileResource(ResourceIdentifier id) + /// Returns a object. + public virtual FleetMemberResource GetFleetMemberResource(ResourceIdentifier id) { - ManagedClusterUpgradeProfileResource.ValidateResourceId(id); - return new ManagedClusterUpgradeProfileResource(Client, id); + FleetMemberResource.ValidateResourceId(id); + return new FleetMemberResource(Client, id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual ContainerServiceManagedClusterResource GetContainerServiceManagedClusterResource(ResourceIdentifier id) + /// Returns a object. + public virtual UpdateRunResource GetUpdateRunResource(ResourceIdentifier id) { - ContainerServiceManagedClusterResource.ValidateResourceId(id); - return new ContainerServiceManagedClusterResource(Client, id); + UpdateRunResource.ValidateResourceId(id); + return new UpdateRunResource(Client, id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual MeshRevisionProfileResource GetMeshRevisionProfileResource(ResourceIdentifier id) + /// Returns a object. + public virtual FleetUpdateStrategyResource GetFleetUpdateStrategyResource(ResourceIdentifier id) { - MeshRevisionProfileResource.ValidateResourceId(id); - return new MeshRevisionProfileResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual MeshUpgradeProfileResource GetMeshUpgradeProfileResource(ResourceIdentifier id) - { - MeshUpgradeProfileResource.ValidateResourceId(id); - return new MeshUpgradeProfileResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual ContainerServiceMaintenanceConfigurationResource GetContainerServiceMaintenanceConfigurationResource(ResourceIdentifier id) - { - ContainerServiceMaintenanceConfigurationResource.ValidateResourceId(id); - return new ContainerServiceMaintenanceConfigurationResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual ContainerServiceAgentPoolResource GetContainerServiceAgentPoolResource(ResourceIdentifier id) - { - ContainerServiceAgentPoolResource.ValidateResourceId(id); - return new ContainerServiceAgentPoolResource(Client, id); - } - - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfileResource(ResourceIdentifier id) - { - AgentPoolUpgradeProfileResource.ValidateResourceId(id); - return new AgentPoolUpgradeProfileResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual ContainerServicePrivateEndpointConnectionResource GetContainerServicePrivateEndpointConnectionResource(ResourceIdentifier id) - { - ContainerServicePrivateEndpointConnectionResource.ValidateResourceId(id); - return new ContainerServicePrivateEndpointConnectionResource(Client, id); - } - - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual AgentPoolSnapshotResource GetAgentPoolSnapshotResource(ResourceIdentifier id) - { - AgentPoolSnapshotResource.ValidateResourceId(id); - return new AgentPoolSnapshotResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual ContainerServiceTrustedAccessRoleBindingResource GetContainerServiceTrustedAccessRoleBindingResource(ResourceIdentifier id) - { - ContainerServiceTrustedAccessRoleBindingResource.ValidateResourceId(id); - return new ContainerServiceTrustedAccessRoleBindingResource(Client, id); + FleetUpdateStrategyResource.ValidateResourceId(id); + return new FleetUpdateStrategyResource(Client, id); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs index c0fa202bd1ae..484c45a8ef18 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs @@ -33,142 +33,73 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. - /// An object representing collection of ContainerServiceManagedClusterResources and their operations over a ContainerServiceManagedClusterResource. - public virtual ContainerServiceManagedClusterCollection GetContainerServiceManagedClusters() + /// Gets a collection of FleetResources in the ResourceGroupResource. + /// An object representing collection of FleetResources and their operations over a FleetResource. + public virtual FleetCollection GetFleets() { - return GetCachedClient(client => new ContainerServiceManagedClusterCollection(client, Id)); + return GetCachedClient(client => new FleetCollection(client, Id)); } /// - /// Gets a managed cluster. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// ManagedClusters_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetContainerServiceManagedClusterAsync(string resourceName, CancellationToken cancellationToken = default) + public virtual async Task> GetFleetAsync(string fleetName, CancellationToken cancellationToken = default) { - return await GetContainerServiceManagedClusters().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a managed cluster. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// ManagedClusters_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetContainerServiceManagedCluster(string resourceName, CancellationToken cancellationToken = default) + public virtual Response GetFleet(string fleetName, CancellationToken cancellationToken = default) { - return GetContainerServiceManagedClusters().Get(resourceName, cancellationToken); - } - - /// Gets a collection of AgentPoolSnapshotResources in the ResourceGroupResource. - /// An object representing collection of AgentPoolSnapshotResources and their operations over a AgentPoolSnapshotResource. - public virtual AgentPoolSnapshotCollection GetAgentPoolSnapshots() - { - return GetCachedClient(client => new AgentPoolSnapshotCollection(client, Id)); - } - - /// - /// Gets a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetAgentPoolSnapshotAsync(string resourceName, CancellationToken cancellationToken = default) - { - return await GetAgentPoolSnapshots().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a snapshot. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} - /// - /// - /// Operation Id - /// Snapshots_Get - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetAgentPoolSnapshot(string resourceName, CancellationToken cancellationToken = default) - { - return GetAgentPoolSnapshots().Get(resourceName, cancellationToken); + return GetFleets().Get(fleetName, cancellationToken); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs index fadc63f13095..33cb1ea0c5c2 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs @@ -5,27 +5,18 @@ #nullable disable -using System; using System.Threading; -using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; namespace Azure.ResourceManager.ContainerService.Mocking { /// A class to add extension methods to SubscriptionResource. public partial class MockableContainerServiceSubscriptionResource : ArmResource { - private ClientDiagnostics _managedClustersClientDiagnostics; - private ManagedClustersRestOperations _managedClustersRestClient; - private ClientDiagnostics _containerServiceManagedClusterManagedClustersClientDiagnostics; - private ManagedClustersRestOperations _containerServiceManagedClusterManagedClustersRestClient; - private ClientDiagnostics _agentPoolSnapshotSnapshotsClientDiagnostics; - private SnapshotsRestOperations _agentPoolSnapshotSnapshotsRestClient; - private ClientDiagnostics _trustedAccessRolesClientDiagnostics; - private TrustedAccessRolesRestOperations _trustedAccessRolesRestClient; + private ClientDiagnostics _fleetClientDiagnostics; + private FleetsRestOperations _fleetRestClient; /// Initializes a new instance of the class for mocking. protected MockableContainerServiceSubscriptionResource() @@ -39,14 +30,8 @@ internal MockableContainerServiceSubscriptionResource(ArmClient client, Resource { } - private ClientDiagnostics ManagedClustersClientDiagnostics => _managedClustersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ManagedClustersRestOperations ManagedClustersRestClient => _managedClustersRestClient ??= new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics ContainerServiceManagedClusterManagedClustersClientDiagnostics => _containerServiceManagedClusterManagedClustersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceManagedClusterResource.ResourceType.Namespace, Diagnostics); - private ManagedClustersRestOperations ContainerServiceManagedClusterManagedClustersRestClient => _containerServiceManagedClusterManagedClustersRestClient ??= new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ContainerServiceManagedClusterResource.ResourceType)); - private ClientDiagnostics AgentPoolSnapshotSnapshotsClientDiagnostics => _agentPoolSnapshotSnapshotsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", AgentPoolSnapshotResource.ResourceType.Namespace, Diagnostics); - private SnapshotsRestOperations AgentPoolSnapshotSnapshotsRestClient => _agentPoolSnapshotSnapshotsRestClient ??= new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AgentPoolSnapshotResource.ResourceType)); - private ClientDiagnostics TrustedAccessRolesClientDiagnostics => _trustedAccessRolesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private TrustedAccessRolesRestOperations TrustedAccessRolesRestClient => _trustedAccessRolesRestClient ??= new TrustedAccessRolesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics FleetClientDiagnostics => _fleetClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerService", FleetResource.ResourceType.Namespace, Diagnostics); + private FleetsRestOperations FleetRestClient => _fleetRestClient ??= new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FleetResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -54,320 +39,64 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of MeshRevisionProfileResources in the SubscriptionResource. - /// The name of the Azure region. - /// An object representing collection of MeshRevisionProfileResources and their operations over a MeshRevisionProfileResource. - public virtual MeshRevisionProfileCollection GetMeshRevisionProfiles(AzureLocation location) - { - return new MeshRevisionProfileCollection(Client, Id, location); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetMeshRevisionProfileAsync(AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - return await GetMeshRevisionProfiles(location).GetAsync(mode, cancellationToken).ConfigureAwait(false); - } - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades + /// Lists fleets in the specified subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile + /// Fleets_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// - /// - /// - /// - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetMeshRevisionProfile(AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - return GetMeshRevisionProfiles(location).Get(mode, cancellationToken); - } - - /// - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions - /// - /// - /// Operation Id - /// ManagedClusters_ListKubernetesVersions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The name of the Azure region. - /// The cancellation token to use. - public virtual async Task> GetKubernetesVersionsManagedClusterAsync(AzureLocation location, CancellationToken cancellationToken = default) - { - using var scope = ManagedClustersClientDiagnostics.CreateScope("MockableContainerServiceSubscriptionResource.GetKubernetesVersionsManagedCluster"); - scope.Start(); - try - { - var response = await ManagedClustersRestClient.ListKubernetesVersionsAsync(Id.SubscriptionId, location, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions - /// - /// - /// Operation Id - /// ManagedClusters_ListKubernetesVersions - /// - /// - /// Default Api Version - /// 2023-10-01 + /// /// /// /// - /// The name of the Azure region. /// The cancellation token to use. - public virtual Response GetKubernetesVersionsManagedCluster(AzureLocation location, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFleetsAsync(CancellationToken cancellationToken = default) { - using var scope = ManagedClustersClientDiagnostics.CreateScope("MockableContainerServiceSubscriptionResource.GetKubernetesVersionsManagedCluster"); - scope.Start(); - try - { - var response = ManagedClustersRestClient.ListKubernetesVersions(Id.SubscriptionId, location, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); } /// - /// Gets a list of managed clusters in the specified subscription. + /// Lists fleets in the specified subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters + /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets /// /// /// Operation Id - /// ManagedClusters_List + /// Fleets_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetContainerServiceManagedClustersAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), ContainerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetContainerServiceManagedClusters", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of managed clusters in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters - /// - /// - /// Operation Id - /// ManagedClusters_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetContainerServiceManagedClusters(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), ContainerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetContainerServiceManagedClusters", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of snapshots in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots - /// - /// - /// Operation Id - /// Snapshots_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAgentPoolSnapshotsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AgentPoolSnapshotSnapshotsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AgentPoolSnapshotSnapshotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), AgentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetAgentPoolSnapshots", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of snapshots in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots - /// - /// - /// Operation Id - /// Snapshots_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAgentPoolSnapshots(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AgentPoolSnapshotSnapshotsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AgentPoolSnapshotSnapshotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), AgentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetAgentPoolSnapshots", "value", "nextLink", cancellationToken); - } - - /// - /// List supported trusted access roles. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles - /// - /// - /// Operation Id - /// TrustedAccessRoles_List - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// - /// The name of the Azure region. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetTrustedAccessRolesAsync(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => TrustedAccessRolesRestClient.CreateListRequest(Id.SubscriptionId, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TrustedAccessRolesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole(e), TrustedAccessRolesClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetTrustedAccessRoles", "value", "nextLink", cancellationToken); - } - - /// - /// List supported trusted access roles. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles - /// - /// - /// Operation Id - /// TrustedAccessRoles_List - /// - /// - /// Default Api Version - /// 2023-10-01 + /// /// /// /// - /// The name of the Azure region. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetTrustedAccessRoles(AzureLocation location, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFleets(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => TrustedAccessRolesRestClient.CreateListRequest(Id.SubscriptionId, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TrustedAccessRolesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole(e), TrustedAccessRolesClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetTrustedAccessRoles", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableContainerServiceSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetCollection.cs new file mode 100644 index 000000000000..4c94511490a7 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleets method from an instance of . + /// + public partial class FleetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", FleetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetResource.ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Fleet resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetName, FleetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Fleet resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetName, FleetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists fleets in the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets + /// + /// + /// Operation Id + /// Fleets_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists fleets in the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets + /// + /// + /// Operation Id + /// Fleets_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.Serialization.cs index ad229b3d5e09..1f5278c091ba 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.Serialization.cs @@ -15,19 +15,29 @@ namespace Azure.ResourceManager.ContainerService { - public partial class AgentPoolSnapshotData : IUtf8JsonSerializable, IJsonModel + public partial class FleetData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetData)} does not support writing '{format}' format."); } writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -63,45 +73,15 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsDefined(CreationData)) - { - writer.WritePropertyName("creationData"u8); - writer.WriteObjectValue(CreationData, options); - } - if (Optional.IsDefined(SnapshotType)) - { - writer.WritePropertyName("snapshotType"u8); - writer.WriteStringValue(SnapshotType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (options.Format != "W" && Optional.IsDefined(NodeImageVersion)) - { - writer.WritePropertyName("nodeImageVersion"u8); - writer.WriteStringValue(NodeImageVersion); - } - if (options.Format != "W" && Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(OSSku)) - { - writer.WritePropertyName("osSku"u8); - writer.WriteStringValue(OSSku.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(VmSize)) + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { - writer.WritePropertyName("vmSize"u8); - writer.WriteStringValue(VmSize); + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(EnableFips)) + if (Optional.IsDefined(HubProfile)) { - writer.WritePropertyName("enableFIPS"u8); - writer.WriteBooleanValue(EnableFips.Value); + writer.WritePropertyName("hubProfile"u8); + writer.WriteObjectValue(HubProfile, options); } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -122,19 +102,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - AgentPoolSnapshotData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolSnapshotData(document.RootElement, options); + return DeserializeFleetData(document.RootElement, options); } - internal static AgentPoolSnapshotData DeserializeAgentPoolSnapshotData(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetData DeserializeFleetData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -142,24 +122,38 @@ internal static AgentPoolSnapshotData DeserializeAgentPoolSnapshotData(JsonEleme { return null; } + ETag? etag = default; + ResourceManager.Models.ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - ContainerServiceCreationData creationData = default; - SnapshotType? snapshotType = default; - string kubernetesVersion = default; - string nodeImageVersion = default; - ContainerServiceOSType? osType = default; - ContainerServiceOSSku? osSku = default; - string vmSize = default; - bool? enableFIPS = default; + FleetProvisioningState? provisioningState = default; + FleetHubProfile hubProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,64 +206,22 @@ internal static AgentPoolSnapshotData DeserializeAgentPoolSnapshotData(JsonEleme } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("creationData"u8)) + if (property0.NameEquals("provisioningState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - creationData = ContainerServiceCreationData.DeserializeContainerServiceCreationData(property0.Value, options); - continue; - } - if (property0.NameEquals("snapshotType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - snapshotType = new SnapshotType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("nodeImageVersion"u8)) - { - nodeImageVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("osType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osType = new ContainerServiceOSType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("osSku"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osSku = new ContainerServiceOSSku(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("vmSize"u8)) - { - vmSize = property0.Value.GetString(); + provisioningState = new FleetProvisioningState(property0.Value.GetString()); continue; } - if (property0.NameEquals("enableFIPS"u8)) + if (property0.NameEquals("hubProfile"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enableFIPS = property0.Value.GetBoolean(); + hubProfile = FleetHubProfile.DeserializeFleetHubProfile(property0.Value, options); continue; } } @@ -281,53 +233,49 @@ internal static AgentPoolSnapshotData DeserializeAgentPoolSnapshotData(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolSnapshotData( + return new FleetData( id, name, type, systemData, tags ?? new ChangeTrackingDictionary(), location, - creationData, - snapshotType, - kubernetesVersion, - nodeImageVersion, - osType, - osSku, - vmSize, - enableFIPS, + etag, + identity, + provisioningState, + hubProfile, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetData)} does not support writing '{options.Format}' format."); } } - AgentPoolSnapshotData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolSnapshotData(document.RootElement, options); + return DeserializeFleetData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AgentPoolSnapshotData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.cs new file mode 100644 index 000000000000..298c39013392 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetData.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing the Fleet data model. + /// The Fleet resource. + /// + public partial class FleetData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public FleetData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// Managed identity. + /// The status of the last operation. + /// The FleetHubProfile configures the Fleet's hub. + /// Keeps track of any properties unknown to the library. + internal FleetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, ResourceManager.Models.ManagedServiceIdentity identity, FleetProvisioningState? provisioningState, FleetHubProfile hubProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ETag = etag; + Identity = identity; + ProvisioningState = provisioningState; + HubProfile = hubProfile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetData() + { + } + + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + public ETag? ETag { get; } + /// Managed identity. + public ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } + /// The status of the last operation. + public FleetProvisioningState? ProvisioningState { get; } + /// The FleetHubProfile configures the Fleet's hub. + public FleetHubProfile HubProfile { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberCollection.cs new file mode 100644 index 000000000000..226b00db34a1 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetMembers method from an instance of . + /// + public partial class FleetMemberCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetMemberClientDiagnostics; + private readonly FleetMembersRestOperations _fleetMemberRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetMemberCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetMemberCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetMemberClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", FleetMemberResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetMemberResource.ResourceType, out string fleetMemberApiVersion); + _fleetMemberRestClient = new FleetMembersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetMemberApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Create a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMembers_Create + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Fleet member resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetMemberName, FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMembers_Create + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Fleet member resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetMemberName, FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.Get"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetMember + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.Get"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List FleetMember resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members + /// + /// + /// Operation Id + /// FleetMembers_ListByFleet + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetMemberRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetMemberRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetMemberResource(Client, FleetMemberData.DeserializeFleetMemberData(e)), _fleetMemberClientDiagnostics, Pipeline, "FleetMemberCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List FleetMember resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members + /// + /// + /// Operation Id + /// FleetMembers_ListByFleet + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetMemberRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetMemberRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetMemberResource(Client, FleetMemberData.DeserializeFleetMemberData(e)), _fleetMemberClientDiagnostics, Pipeline, "FleetMemberCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.Exists"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetMemberRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} + /// + /// + /// Operation Id + /// FleetMembers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetMemberRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.Serialization.cs similarity index 63% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.Serialization.cs index e6002253cdb7..4f670eea2f68 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.Serialization.cs @@ -15,19 +15,24 @@ namespace Azure.ResourceManager.ContainerService { - public partial class ContainerServiceTrustedAccessRoleBindingData : IUtf8JsonSerializable, IJsonModel + public partial class FleetMemberData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleBindingData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberData)} does not support writing '{format}' format."); } writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (options.Format != "W") { writer.WritePropertyName("id"u8); @@ -50,20 +55,21 @@ void IJsonModel.Write(Utf8JsonWrit } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); + if (Optional.IsDefined(ClusterResourceId)) + { + writer.WritePropertyName("clusterResourceId"u8); + writer.WriteStringValue(ClusterResourceId); + } + if (Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group); + } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - writer.WritePropertyName("sourceResourceId"u8); - writer.WriteStringValue(SourceResourceId); - writer.WritePropertyName("roles"u8); - writer.WriteStartArray(); - foreach (var item in Roles) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -83,19 +89,19 @@ void IJsonModel.Write(Utf8JsonWrit writer.WriteEndObject(); } - ContainerServiceTrustedAccessRoleBindingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetMemberData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleBindingData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement, options); + return DeserializeFleetMemberData(document.RootElement, options); } - internal static ContainerServiceTrustedAccessRoleBindingData DeserializeContainerServiceTrustedAccessRoleBindingData(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetMemberData DeserializeFleetMemberData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -103,17 +109,27 @@ internal static ContainerServiceTrustedAccessRoleBindingData DeserializeContaine { return null; } + ETag? etag = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - ContainerServiceTrustedAccessRoleBindingProvisioningState? provisioningState = default; - ResourceIdentifier sourceResourceId = default; - IList roles = default; + ResourceIdentifier clusterResourceId = default; + string group = default; + FleetMemberProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -147,28 +163,27 @@ internal static ContainerServiceTrustedAccessRoleBindingData DeserializeContaine } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("provisioningState"u8)) + if (property0.NameEquals("clusterResourceId"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new ContainerServiceTrustedAccessRoleBindingProvisioningState(property0.Value.GetString()); + clusterResourceId = new ResourceIdentifier(property0.Value.GetString()); continue; } - if (property0.NameEquals("sourceResourceId"u8)) + if (property0.NameEquals("group"u8)) { - sourceResourceId = new ResourceIdentifier(property0.Value.GetString()); + group = property0.Value.GetString(); continue; } - if (property0.NameEquals("roles"u8)) + if (property0.NameEquals("provisioningState"u8)) { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) + if (property0.Value.ValueKind == JsonValueKind.Null) { - array.Add(item.GetString()); + continue; } - roles = array; + provisioningState = new FleetMemberProvisioningState(property0.Value.GetString()); continue; } } @@ -180,46 +195,47 @@ internal static ContainerServiceTrustedAccessRoleBindingData DeserializeContaine } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceTrustedAccessRoleBindingData( + return new FleetMemberData( id, name, type, systemData, + etag, + clusterResourceId, + group, provisioningState, - sourceResourceId, - roles, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleBindingData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberData)} does not support writing '{options.Format}' format."); } } - ContainerServiceTrustedAccessRoleBindingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetMemberData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement, options); + return DeserializeFleetMemberData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleBindingData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.cs new file mode 100644 index 000000000000..ca0f366b464b --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberData.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing the FleetMember data model. + /// A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. + /// + public partial class FleetMemberData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetMemberData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'. + /// The group this member belongs to for multi-cluster update management. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal FleetMemberData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? etag, ResourceIdentifier clusterResourceId, string group, FleetMemberProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ETag = etag; + ClusterResourceId = clusterResourceId; + Group = group; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + public ETag? ETag { get; } + /// The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'. + public ResourceIdentifier ClusterResourceId { get; set; } + /// The group this member belongs to for multi-cluster update management. + public string Group { get; set; } + /// The status of the last operation. + public FleetMemberProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.Serialization.cs new file mode 100644 index 000000000000..bc76426a3b0d --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerService +{ + public partial class FleetMemberResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetMemberData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetMemberData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.cs similarity index 51% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.cs index 56db01f3bb7c..f7abdf52b783 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetMemberResource.cs @@ -11,57 +11,58 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; namespace Azure.ResourceManager.ContainerService { /// - /// A Class representing a ContainerServicePrivateEndpointConnection along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetContainerServicePrivateEndpointConnectionResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServicePrivateEndpointConnection method. + /// A Class representing a FleetMember along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetMemberResource method. + /// Otherwise you can get one from its parent resource using the GetFleetMember method. /// - public partial class ContainerServicePrivateEndpointConnectionResource : ArmResource + public partial class FleetMemberResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The resourceName. - /// The privateEndpointConnectionName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + /// The fleetName. + /// The fleetMemberName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; - private readonly PrivateEndpointConnectionsRestOperations _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient; - private readonly ContainerServicePrivateEndpointConnectionData _data; + private readonly ClientDiagnostics _fleetMemberClientDiagnostics; + private readonly FleetMembersRestOperations _fleetMemberRestClient; + private readonly FleetMemberData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/privateEndpointConnections"; + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/members"; - /// Initializes a new instance of the class for mocking. - protected ContainerServicePrivateEndpointConnectionResource() + /// Initializes a new instance of the class for mocking. + protected FleetMemberResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ContainerServicePrivateEndpointConnectionResource(ArmClient client, ContainerServicePrivateEndpointConnectionData data) : this(client, data.Id) + internal FleetMemberResource(ArmClient client, FleetMemberData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal ContainerServicePrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal FleetMemberResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServicePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); - _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServicePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _fleetMemberClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetMemberApiVersion); + _fleetMemberRestClient = new FleetMembersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetMemberApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -72,7 +73,7 @@ internal ContainerServicePrivateEndpointConnectionResource(ArmClient client, Res /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ContainerServicePrivateEndpointConnectionData Data + public virtual FleetMemberData Data { get { @@ -89,37 +90,37 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// Get a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// FleetMembers_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Get"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Get"); scope.Start(); try { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _fleetMemberRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -129,37 +130,37 @@ public virtual async Task - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// Get a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// FleetMembers_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Get"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Get"); scope.Start(); try { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _fleetMemberRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetMemberResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -169,36 +170,37 @@ public virtual Response Get(C } /// - /// Deletes a private endpoint connection. + /// Delete a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Delete + /// FleetMembers_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Delete"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Delete"); scope.Start(); try { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _fleetMemberRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -211,36 +213,37 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes a private endpoint connection. + /// Delete a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Delete + /// FleetMembers_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Delete"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Delete"); scope.Start(); try { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _fleetMemberRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -253,42 +256,41 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Updates a private endpoint connection. + /// Update a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Update + /// FleetMembers_Update /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The updated private endpoint connection. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Update"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Update"); scope.Start(); try { - var response = await _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var uri = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = await _fleetMemberRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -301,42 +303,41 @@ public virtual async Task - /// Updates a private endpoint connection. + /// Update a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// PrivateEndpointConnections_Update + /// FleetMembers_Update /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The updated private endpoint connection. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ContainerServicePrivateEndpointConnectionResource.Update"); + using var scope = _fleetMemberClientDiagnostics.CreateScope("FleetMemberResource.Update"); scope.Start(); try { - var response = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var uri = _containerServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServicePrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = _fleetMemberRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new FleetMemberOperationSource(Client), _fleetMemberClientDiagnostics, Pipeline, _fleetMemberRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.Serialization.cs new file mode 100644 index 000000000000..8c4be483849d --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerService +{ + public partial class FleetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.cs similarity index 52% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.cs index e3ed5337ca43..31e231d98dc2 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetResource.cs @@ -12,57 +12,58 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ContainerService { /// - /// A Class representing a ContainerServiceAgentPool along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetContainerServiceAgentPoolResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServiceAgentPool method. + /// A Class representing a Fleet along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetResource method. + /// Otherwise you can get one from its parent resource using the GetFleet method. /// - public partial class ContainerServiceAgentPoolResource : ArmResource + public partial class FleetResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The resourceName. - /// The agentPoolName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + /// The fleetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _containerServiceAgentPoolAgentPoolsClientDiagnostics; - private readonly AgentPoolsRestOperations _containerServiceAgentPoolAgentPoolsRestClient; - private readonly ContainerServiceAgentPoolData _data; + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + private readonly FleetData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/agentPools"; + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets"; - /// Initializes a new instance of the class for mocking. - protected ContainerServiceAgentPoolResource() + /// Initializes a new instance of the class for mocking. + protected FleetResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ContainerServiceAgentPoolResource(ArmClient client, ContainerServiceAgentPoolData data) : this(client, data.Id) + internal FleetResource(ArmClient client, FleetData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal ContainerServiceAgentPoolResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal FleetResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _containerServiceAgentPoolAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServiceAgentPoolAgentPoolsApiVersion); - _containerServiceAgentPoolAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceAgentPoolAgentPoolsApiVersion); + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -73,7 +74,7 @@ internal ContainerServiceAgentPoolResource(ArmClient client, ResourceIdentifier /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ContainerServiceAgentPoolData Data + public virtual FleetData Data { get { @@ -89,127 +90,245 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets an object representing a AgentPoolUpgradeProfileResource along with the instance operations that can be performed on it in the ContainerServiceAgentPool. - /// Returns a object. - public virtual AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfile() + /// Gets a collection of FleetMemberResources in the Fleet. + /// An object representing collection of FleetMemberResources and their operations over a FleetMemberResource. + public virtual FleetMemberCollection GetFleetMembers() { - return new AgentPoolUpgradeProfileResource(Client, Id.AppendChildResource("upgradeProfiles", "default")); + return GetCachedClient(client => new FleetMemberCollection(client, Id)); } /// - /// Gets the specified managed cluster agent pool. + /// Get a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// AgentPools_Get + /// FleetMembers_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// + /// The name of the Fleet member resource. /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetMemberAsync(string fleetMemberName, CancellationToken cancellationToken = default) { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Get"); - scope.Start(); - try - { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + return await GetFleetMembers().GetAsync(fleetMemberName, cancellationToken).ConfigureAwait(false); } /// - /// Gets the specified managed cluster agent pool. + /// Get a FleetMember /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName} /// /// /// Operation Id - /// AgentPools_Get + /// FleetMembers_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// + /// The name of the Fleet member resource. /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetMember(string fleetMemberName, CancellationToken cancellationToken = default) { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Get"); - scope.Start(); - try - { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + return GetFleetMembers().Get(fleetMemberName, cancellationToken); + } + + /// Gets a collection of UpdateRunResources in the Fleet. + /// An object representing collection of UpdateRunResources and their operations over a UpdateRunResource. + public virtual UpdateRunCollection GetUpdateRuns() + { + return GetCachedClient(client => new UpdateRunCollection(client, Id)); } /// - /// Deletes an agent pool in the specified managed cluster. + /// Get a UpdateRun /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} /// /// /// Operation Id - /// AgentPools_Delete + /// UpdateRuns_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetUpdateRunAsync(string updateRunName, CancellationToken cancellationToken = default) + { + return await GetUpdateRuns().GetAsync(updateRunName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetUpdateRun(string updateRunName, CancellationToken cancellationToken = default) + { + return GetUpdateRuns().Get(updateRunName, cancellationToken); + } + + /// Gets a collection of FleetUpdateStrategyResources in the Fleet. + /// An object representing collection of FleetUpdateStrategyResources and their operations over a FleetUpdateStrategyResource. + public virtual FleetUpdateStrategyCollection GetFleetUpdateStrategies() + { + return GetCachedClient(client => new FleetUpdateStrategyCollection(client, Id)); + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetUpdateStrategyAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + return await GetFleetUpdateStrategies().GetAsync(updateStrategyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetUpdateStrategy(string updateStrategyName, CancellationToken cancellationToken = default) + { + return GetFleetUpdateStrategies().Get(updateStrategyName, cancellationToken); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Delete"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -219,39 +338,37 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes an agent pool in the specified managed cluster. + /// Gets a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_Delete + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Delete"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -261,42 +378,39 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Creates or updates an agent pool in the specified managed cluster. + /// Delete a Fleet /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_CreateOrUpdate + /// Fleets_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Update"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _fleetRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) @@ -307,42 +421,39 @@ public virtual async Task> Updat } /// - /// Creates or updates an agent pool in the specified managed cluster. + /// Delete a Fleet /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_CreateOrUpdate + /// Fleets_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Update"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _fleetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); + operation.WaitForCompletionResponse(cancellationToken); return operation; } catch (Exception e) @@ -353,38 +464,43 @@ public virtual ArmOperation Update(WaitUntil } /// - /// 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. + /// Update a Fleet /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_AbortLatestOperation + /// Fleets_Update /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual async Task AbortLatestOperationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AbortLatestOperation"); + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.AbortLatestOperationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _fleetRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) @@ -395,38 +511,43 @@ public virtual async Task AbortLatestOperationAsync(WaitUntil wait } /// - /// 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. + /// Update a Fleet /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_AbortLatestOperation + /// Fleets_Update /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AbortLatestOperation"); + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.AbortLatestOperation(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _fleetRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); + operation.WaitForCompletion(cancellationToken); return operation; } catch (Exception e) @@ -437,39 +558,35 @@ public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, Cancellati } /// - /// 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 + /// Lists the user credentials of a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials /// /// /// Operation Id - /// AgentPools_UpgradeNodeImageVersion + /// Fleets_ListCredentials /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual async Task UpgradeNodeImageVersionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> GetCredentialsAsync(CancellationToken cancellationToken = default) { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.UpgradeNodeImageVersion"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.GetCredentials"); scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.UpgradeNodeImageVersionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateUpgradeNodeImageVersionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; + var response = await _fleetRestClient.ListCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; } catch (Exception e) { @@ -479,39 +596,35 @@ public virtual async Task UpgradeNodeImageVersionAsync(WaitUntil w } /// - /// 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 + /// Lists the user credentials of a Fleet. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials /// /// /// Operation Id - /// AgentPools_UpgradeNodeImageVersion + /// Fleets_ListCredentials /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual ArmOperation UpgradeNodeImageVersion(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual Response GetCredentials(CancellationToken cancellationToken = default) { - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.UpgradeNodeImageVersion"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.GetCredentials"); scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.UpgradeNodeImageVersion(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateUpgradeNodeImageVersionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; + var response = _fleetRestClient.ListCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; } catch (Exception e) { @@ -525,19 +638,19 @@ public virtual ArmOperation UpgradeNodeImageVersion(WaitUntil waitUntil, Cancell /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// @@ -545,12 +658,12 @@ public virtual ArmOperation UpgradeNodeImageVersion(WaitUntil waitUntil, Cancell /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AddTag"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.AddTag"); scope.Start(); try { @@ -559,14 +672,19 @@ public virtual async Task> AddTagAsy var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - current.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -582,19 +700,19 @@ public virtual async Task> AddTagAsy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// @@ -602,12 +720,12 @@ public virtual async Task> AddTagAsy /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AddTag"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.AddTag"); scope.Start(); try { @@ -616,14 +734,19 @@ public virtual Response AddTag(string key, st var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - current.Tags[key] = value; - var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -639,30 +762,30 @@ public virtual Response AddTag(string key, st /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.SetTags"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.SetTags"); scope.Start(); try { @@ -672,14 +795,15 @@ public virtual async Task> SetTagsAs var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - current.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + var patch = new FleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -695,30 +819,30 @@ public virtual async Task> SetTagsAs /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.SetTags"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.SetTags"); scope.Start(); try { @@ -728,14 +852,15 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.RemoveTag"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.RemoveTag"); scope.Start(); try { @@ -783,14 +908,19 @@ public virtual async Task> RemoveTag var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - current.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -806,30 +936,30 @@ public virtual async Task> RemoveTag /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} /// /// /// Operation Id - /// AgentPools_Get + /// Fleets_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.RemoveTag"); + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.RemoveTag"); scope.Start(); try { @@ -838,14 +968,19 @@ public virtual Response RemoveTag(string key, var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - current.Tags.Remove(key); - var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyCollection.cs new file mode 100644 index 000000000000..bb9ace615327 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetUpdateStrategies method from an instance of . + /// + public partial class FleetUpdateStrategyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetUpdateStrategyClientDiagnostics; + private readonly FleetUpdateStrategiesRestOperations _fleetUpdateStrategyRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetUpdateStrategyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetUpdateStrategyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetUpdateStrategyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", FleetUpdateStrategyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetUpdateStrategyResource.ResourceType, out string fleetUpdateStrategyApiVersion); + _fleetUpdateStrategyRestClient = new FleetUpdateStrategiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetUpdateStrategyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Get"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FleetUpdateStrategy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Get"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List FleetUpdateStrategy resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies + /// + /// + /// Operation Id + /// FleetUpdateStrategies_ListByFleet + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetUpdateStrategyRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetUpdateStrategyRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetUpdateStrategyResource(Client, FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(e)), _fleetUpdateStrategyClientDiagnostics, Pipeline, "FleetUpdateStrategyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List FleetUpdateStrategy resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies + /// + /// + /// Operation Id + /// FleetUpdateStrategies_ListByFleet + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetUpdateStrategyRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetUpdateStrategyRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetUpdateStrategyResource(Client, FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(e)), _fleetUpdateStrategyClientDiagnostics, Pipeline, "FleetUpdateStrategyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.Exists"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} + /// + /// + /// Operation Id + /// FleetUpdateStrategies_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateStrategy resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string updateStrategyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); + + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.Serialization.cs similarity index 60% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.Serialization.cs index 584aaaeadae8..0f19601e7f54 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.Serialization.cs @@ -12,23 +12,27 @@ using Azure.Core; using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.ContainerService { - public partial class ContainerServicePrivateEndpointConnectionData : IUtf8JsonSerializable, IJsonModel + public partial class FleetUpdateStrategyData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support writing '{format}' format."); } writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (options.Format != "W") { writer.WritePropertyName("id"u8); @@ -56,15 +60,10 @@ void IJsonModel.Write(Utf8JsonWri writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (Optional.IsDefined(PrivateEndpoint)) + if (Optional.IsDefined(Strategy)) { - writer.WritePropertyName("privateEndpoint"u8); - JsonSerializer.Serialize(writer, PrivateEndpoint); - } - if (Optional.IsDefined(ConnectionState)) - { - writer.WritePropertyName("privateLinkServiceConnectionState"u8); - writer.WriteObjectValue(ConnectionState, options); + writer.WritePropertyName("strategy"u8); + writer.WriteObjectValue(Strategy, options); } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -85,19 +84,19 @@ void IJsonModel.Write(Utf8JsonWri writer.WriteEndObject(); } - ContainerServicePrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetUpdateStrategyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement, options); + return DeserializeFleetUpdateStrategyData(document.RootElement, options); } - internal static ContainerServicePrivateEndpointConnectionData DeserializeContainerServicePrivateEndpointConnectionData(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetUpdateStrategyData DeserializeFleetUpdateStrategyData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -105,17 +104,26 @@ internal static ContainerServicePrivateEndpointConnectionData DeserializeContain { return null; } + ETag? etag = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - ContainerServicePrivateEndpointConnectionProvisioningState? provisioningState = default; - WritableSubResource privateEndpoint = default; - ContainerServicePrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + FleetUpdateStrategyProvisioningState? provisioningState = default; + UpdateRunStrategy strategy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -155,25 +163,16 @@ internal static ContainerServicePrivateEndpointConnectionData DeserializeContain { continue; } - provisioningState = new ContainerServicePrivateEndpointConnectionProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("privateEndpoint"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - privateEndpoint = JsonSerializer.Deserialize(property0.Value.GetRawText()); + provisioningState = new FleetUpdateStrategyProvisioningState(property0.Value.GetString()); continue; } - if (property0.NameEquals("privateLinkServiceConnectionState"u8)) + if (property0.NameEquals("strategy"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - privateLinkServiceConnectionState = ContainerServicePrivateLinkServiceConnectionState.DeserializeContainerServicePrivateLinkServiceConnectionState(property0.Value, options); + strategy = UpdateRunStrategy.DeserializeUpdateRunStrategy(property0.Value, options); continue; } } @@ -185,46 +184,46 @@ internal static ContainerServicePrivateEndpointConnectionData DeserializeContain } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServicePrivateEndpointConnectionData( + return new FleetUpdateStrategyData( id, name, type, systemData, + etag, provisioningState, - privateEndpoint, - privateLinkServiceConnectionState, + strategy, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support writing '{options.Format}' format."); } } - ContainerServicePrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetUpdateStrategyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement, options); + return DeserializeFleetUpdateStrategyData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.cs new file mode 100644 index 000000000000..a15da9482093 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing the FleetUpdateStrategy data model. + /// Defines a multi-stage process to perform update operations across members of a Fleet. + /// + public partial class FleetUpdateStrategyData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetUpdateStrategyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// The provisioning state of the UpdateStrategy resource. + /// Defines the update sequence of the clusters. + /// Keeps track of any properties unknown to the library. + internal FleetUpdateStrategyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? etag, FleetUpdateStrategyProvisioningState? provisioningState, UpdateRunStrategy strategy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ETag = etag; + ProvisioningState = provisioningState; + Strategy = strategy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + public ETag? ETag { get; } + /// The provisioning state of the UpdateStrategy resource. + public FleetUpdateStrategyProvisioningState? ProvisioningState { get; } + /// Defines the update sequence of the clusters. + internal UpdateRunStrategy Strategy { get; set; } + /// The list of stages that compose this update run. Min size: 1. + public IList StrategyStages + { + get => Strategy is null ? default : Strategy.Stages; + set => Strategy = new UpdateRunStrategy(value); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.Serialization.cs new file mode 100644 index 000000000000..4582bb023ea3 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerService +{ + public partial class FleetUpdateStrategyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetUpdateStrategyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetUpdateStrategyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.cs similarity index 53% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.cs index c31d699ddd30..541671d64bf7 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/FleetUpdateStrategyResource.cs @@ -15,53 +15,53 @@ namespace Azure.ResourceManager.ContainerService { /// - /// A Class representing a ContainerServiceTrustedAccessRoleBinding along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetContainerServiceTrustedAccessRoleBindingResource method. - /// Otherwise you can get one from its parent resource using the GetContainerServiceTrustedAccessRoleBinding method. + /// A Class representing a FleetUpdateStrategy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetUpdateStrategyResource method. + /// Otherwise you can get one from its parent resource using the GetFleetUpdateStrategy method. /// - public partial class ContainerServiceTrustedAccessRoleBindingResource : ArmResource + public partial class FleetUpdateStrategyResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The resourceName. - /// The trustedAccessRoleBindingName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName) + /// The fleetName. + /// The updateStrategyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics; - private readonly TrustedAccessRoleBindingsRestOperations _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient; - private readonly ContainerServiceTrustedAccessRoleBindingData _data; + private readonly ClientDiagnostics _fleetUpdateStrategyClientDiagnostics; + private readonly FleetUpdateStrategiesRestOperations _fleetUpdateStrategyRestClient; + private readonly FleetUpdateStrategyData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings"; + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/updateStrategies"; - /// Initializes a new instance of the class for mocking. - protected ContainerServiceTrustedAccessRoleBindingResource() + /// Initializes a new instance of the class for mocking. + protected FleetUpdateStrategyResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ContainerServiceTrustedAccessRoleBindingResource(ArmClient client, ContainerServiceTrustedAccessRoleBindingData data) : this(client, data.Id) + internal FleetUpdateStrategyResource(ArmClient client, FleetUpdateStrategyData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal ContainerServiceTrustedAccessRoleBindingResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal FleetUpdateStrategyResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsApiVersion); - _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient = new TrustedAccessRoleBindingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsApiVersion); + _fleetUpdateStrategyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetUpdateStrategyApiVersion); + _fleetUpdateStrategyRestClient = new FleetUpdateStrategiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetUpdateStrategyApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -72,7 +72,7 @@ internal ContainerServiceTrustedAccessRoleBindingResource(ArmClient client, Reso /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ContainerServiceTrustedAccessRoleBindingData Data + public virtual FleetUpdateStrategyData Data { get { @@ -89,37 +89,37 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Get a trusted access role binding. + /// Get a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// TrustedAccessRoleBindings_Get + /// FleetUpdateStrategies_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Get"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Get"); scope.Start(); try { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _fleetUpdateStrategyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -129,37 +129,37 @@ public virtual async Task - /// Get a trusted access role binding. + /// Get a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// TrustedAccessRoleBindings_Get + /// FleetUpdateStrategies_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Get"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Get"); scope.Start(); try { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _fleetUpdateStrategyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerServiceTrustedAccessRoleBindingResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new FleetUpdateStrategyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -169,36 +169,37 @@ public virtual Response Get(Ca } /// - /// Delete a trusted access role binding. + /// Delete a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// TrustedAccessRoleBindings_Delete + /// FleetUpdateStrategies_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Delete"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Delete"); scope.Start(); try { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _fleetUpdateStrategyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -211,36 +212,37 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Delete a trusted access role binding. + /// Delete a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// TrustedAccessRoleBindings_Delete + /// FleetUpdateStrategies_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) { - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Delete"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Delete"); scope.Start(); try { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _fleetUpdateStrategyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -253,40 +255,42 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Create or update a trusted access role binding + /// Create a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// TrustedAccessRoleBindings_CreateOrUpdate + /// FleetUpdateStrategies_CreateOrUpdate /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// A trusted access role binding. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Update"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Update"); scope.Start(); try { - var response = await _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceTrustedAccessRoleBindingOperationSource(Client), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _fleetUpdateStrategyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -299,40 +303,42 @@ public virtual async Task - /// Create or update a trusted access role binding + /// Create a FleetUpdateStrategy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName} /// /// /// Operation Id - /// TrustedAccessRoleBindings_CreateOrUpdate + /// FleetUpdateStrategies_CreateOrUpdate /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-04-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// A trusted access role binding. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics.CreateScope("ContainerServiceTrustedAccessRoleBindingResource.Update"); + using var scope = _fleetUpdateStrategyClientDiagnostics.CreateScope("FleetUpdateStrategyResource.Update"); scope.Start(); try { - var response = _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceTrustedAccessRoleBindingOperationSource(Client), _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsClientDiagnostics, Pipeline, _containerServiceTrustedAccessRoleBindingTrustedAccessRoleBindingsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _fleetUpdateStrategyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceAgentPoolOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceAgentPoolOperationSource.cs deleted file mode 100644 index 45d44cd33b61..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceAgentPoolOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService -{ - internal class ContainerServiceAgentPoolOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ContainerServiceAgentPoolOperationSource(ArmClient client) - { - _client = client; - } - - ContainerServiceAgentPoolResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(document.RootElement); - return new ContainerServiceAgentPoolResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(document.RootElement); - return new ContainerServiceAgentPoolResource(_client, data); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceManagedClusterOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceManagedClusterOperationSource.cs deleted file mode 100644 index c9581509812a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceManagedClusterOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService -{ - internal class ContainerServiceManagedClusterOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ContainerServiceManagedClusterOperationSource(ArmClient client) - { - _client = client; - } - - ContainerServiceManagedClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(document.RootElement); - return new ContainerServiceManagedClusterResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(document.RootElement); - return new ContainerServiceManagedClusterResource(_client, data); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceTrustedAccessRoleBindingOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceTrustedAccessRoleBindingOperationSource.cs deleted file mode 100644 index 2750b8b78516..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ContainerServiceTrustedAccessRoleBindingOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService -{ - internal class ContainerServiceTrustedAccessRoleBindingOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ContainerServiceTrustedAccessRoleBindingOperationSource(ArmClient client) - { - _client = client; - } - - ContainerServiceTrustedAccessRoleBindingResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement); - return new ContainerServiceTrustedAccessRoleBindingResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement); - return new ContainerServiceTrustedAccessRoleBindingResource(_client, data); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs new file mode 100644 index 000000000000..4b59317e4118 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetMemberOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService +{ + internal class FleetMemberOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetMemberOperationSource(ArmClient client) + { + _client = client; + } + + FleetMemberResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetMemberData.DeserializeFleetMemberData(document.RootElement); + return new FleetMemberResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetMemberData.DeserializeFleetMemberData(document.RootElement); + return new FleetMemberResource(_client, data); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetOperationSource.cs new file mode 100644 index 000000000000..295d055a57c5 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService +{ + internal class FleetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetOperationSource(ArmClient client) + { + _client = client; + } + + FleetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetData.DeserializeFleetData(document.RootElement); + return new FleetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetData.DeserializeFleetData(document.RootElement); + return new FleetResource(_client, data); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs new file mode 100644 index 000000000000..9d6f4373cc7b --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/FleetUpdateStrategyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService +{ + internal class FleetUpdateStrategyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetUpdateStrategyOperationSource(ArmClient client) + { + _client = client; + } + + FleetUpdateStrategyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return new FleetUpdateStrategyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); + return new FleetUpdateStrategyResource(_client, data); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ManagedClusterRunCommandResultOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ManagedClusterRunCommandResultOperationSource.cs deleted file mode 100644 index 803e8e9727db..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/ManagedClusterRunCommandResultOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal class ManagedClusterRunCommandResultOperationSource : IOperationSource - { - ManagedClusterRunCommandResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return ManagedClusterRunCommandResult.DeserializeManagedClusterRunCommandResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return ManagedClusterRunCommandResult.DeserializeManagedClusterRunCommandResult(document.RootElement); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs new file mode 100644 index 000000000000..1b9434c57106 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/LongRunningOperation/UpdateRunOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService +{ + internal class UpdateRunOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal UpdateRunOperationSource(ArmClient client) + { + _client = client; + } + + UpdateRunResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = UpdateRunData.DeserializeUpdateRunData(document.RootElement); + return new UpdateRunResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = UpdateRunData.DeserializeUpdateRunData(document.RootElement); + return new UpdateRunResource(_client, data); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.Serialization.cs deleted file mode 100644 index 0cbbdc5f5d95..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.Serialization.cs +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ManagedClusterUpgradeProfileData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterUpgradeProfileData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("controlPlaneProfile"u8); - writer.WriteObjectValue(ControlPlaneProfile, options); - writer.WritePropertyName("agentPoolProfiles"u8); - writer.WriteStartArray(); - foreach (var item in AgentPoolProfiles) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterUpgradeProfileData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterUpgradeProfileData(document.RootElement, options); - } - - internal static ManagedClusterUpgradeProfileData DeserializeManagedClusterUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - ManagedClusterPoolUpgradeProfile controlPlaneProfile = default; - IReadOnlyList agentPoolProfiles = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("controlPlaneProfile"u8)) - { - controlPlaneProfile = ManagedClusterPoolUpgradeProfile.DeserializeManagedClusterPoolUpgradeProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("agentPoolProfiles"u8)) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ManagedClusterPoolUpgradeProfile.DeserializeManagedClusterPoolUpgradeProfile(item, options)); - } - agentPoolProfiles = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterUpgradeProfileData( - id, - name, - type, - systemData, - controlPlaneProfile, - agentPoolProfiles, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterUpgradeProfileData)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterUpgradeProfileData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterUpgradeProfileData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.cs deleted file mode 100644 index 60e8ec5bb262..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileData.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the ManagedClusterUpgradeProfile data model. - /// The list of available upgrades for compute pools. - /// - public partial class ManagedClusterUpgradeProfileData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The list of available upgrade versions for the control plane. - /// The list of available upgrade versions for agent pools. - /// or is null. - internal ManagedClusterUpgradeProfileData(ManagedClusterPoolUpgradeProfile controlPlaneProfile, IEnumerable agentPoolProfiles) - { - Argument.AssertNotNull(controlPlaneProfile, nameof(controlPlaneProfile)); - Argument.AssertNotNull(agentPoolProfiles, nameof(agentPoolProfiles)); - - ControlPlaneProfile = controlPlaneProfile; - AgentPoolProfiles = agentPoolProfiles.ToList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of available upgrade versions for the control plane. - /// The list of available upgrade versions for agent pools. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ManagedClusterPoolUpgradeProfile controlPlaneProfile, IReadOnlyList agentPoolProfiles, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ControlPlaneProfile = controlPlaneProfile; - AgentPoolProfiles = agentPoolProfiles; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterUpgradeProfileData() - { - } - - /// The list of available upgrade versions for the control plane. - public ManagedClusterPoolUpgradeProfile ControlPlaneProfile { get; } - /// The list of available upgrade versions for agent pools. - public IReadOnlyList AgentPoolProfiles { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.Serialization.cs deleted file mode 100644 index a0579a3fa931..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class ManagedClusterUpgradeProfileResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ManagedClusterUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ManagedClusterUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs deleted file mode 100644 index ae15f4b29f21..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a ManagedClusterUpgradeProfile along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetManagedClusterUpgradeProfileResource method. - /// Otherwise you can get one from its parent resource using the GetManagedClusterUpgradeProfile method. - /// - public partial class ManagedClusterUpgradeProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _managedClusterUpgradeProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _managedClusterUpgradeProfileManagedClustersRestClient; - private readonly ManagedClusterUpgradeProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/upgradeProfiles"; - - /// Initializes a new instance of the class for mocking. - protected ManagedClusterUpgradeProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ManagedClusterUpgradeProfileResource(ArmClient client, ManagedClusterUpgradeProfileData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ManagedClusterUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _managedClusterUpgradeProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string managedClusterUpgradeProfileManagedClustersApiVersion); - _managedClusterUpgradeProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedClusterUpgradeProfileManagedClustersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual ManagedClusterUpgradeProfileData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the upgrade profile of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default - /// - /// - /// Operation Id - /// ManagedClusters_GetUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _managedClusterUpgradeProfileManagedClustersClientDiagnostics.CreateScope("ManagedClusterUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = await _managedClusterUpgradeProfileManagedClustersRestClient.GetUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ManagedClusterUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the upgrade profile of a managed cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default - /// - /// - /// Operation Id - /// ManagedClusters_GetUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _managedClusterUpgradeProfileManagedClustersClientDiagnostics.CreateScope("ManagedClusterUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = _managedClusterUpgradeProfileManagedClustersRestClient.GetUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ManagedClusterUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs deleted file mode 100644 index 73f52e619891..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs +++ /dev/null @@ -1,399 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetMeshRevisionProfiles method from an instance of . - /// - public partial class MeshRevisionProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _meshRevisionProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _meshRevisionProfileManagedClustersRestClient; - private readonly AzureLocation _location; - - /// Initializes a new instance of the class for mocking. - protected MeshRevisionProfileCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - /// The name of the Azure region. - internal MeshRevisionProfileCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) - { - _location = location; - _meshRevisionProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", MeshRevisionProfileResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(MeshRevisionProfileResource.ResourceType, out string meshRevisionProfileManagedClustersApiVersion); - _meshRevisionProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, meshRevisionProfileManagedClustersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.Get"); - scope.Start(); - try - { - var response = await _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfileAsync(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.Get"); - scope.Start(); - try - { - var response = _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfile(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles - /// - /// - /// Operation Id - /// ManagedClusters_ListMeshRevisionProfiles - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _meshRevisionProfileManagedClustersRestClient.CreateListMeshRevisionProfilesRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _meshRevisionProfileManagedClustersRestClient.CreateListMeshRevisionProfilesNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MeshRevisionProfileResource(Client, MeshRevisionProfileData.DeserializeMeshRevisionProfileData(e)), _meshRevisionProfileManagedClustersClientDiagnostics, Pipeline, "MeshRevisionProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles - /// - /// - /// Operation Id - /// ManagedClusters_ListMeshRevisionProfiles - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _meshRevisionProfileManagedClustersRestClient.CreateListMeshRevisionProfilesRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _meshRevisionProfileManagedClustersRestClient.CreateListMeshRevisionProfilesNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MeshRevisionProfileResource(Client, MeshRevisionProfileData.DeserializeMeshRevisionProfileData(e)), _meshRevisionProfileManagedClustersClientDiagnostics, Pipeline, "MeshRevisionProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.Exists"); - scope.Start(); - try - { - var response = await _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfileAsync(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.Exists"); - scope.Start(); - try - { - var response = _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfile(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfileAsync(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfile(Id.SubscriptionId, new AzureLocation(_location), mode, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.cs deleted file mode 100644 index 5463b2507edd..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the MeshRevisionProfile data model. - /// Mesh revision profile for a mesh. - /// - public partial class MeshRevisionProfileData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public MeshRevisionProfileData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Mesh revision profile properties for a mesh. - /// Keeps track of any properties unknown to the library. - internal MeshRevisionProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MeshRevisionProfileProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Mesh revision profile properties for a mesh. - internal MeshRevisionProfileProperties Properties { get; set; } - /// Gets the mesh revisions. - public IList MeshRevisions - { - get - { - if (Properties is null) - Properties = new MeshRevisionProfileProperties(); - return Properties.MeshRevisions; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.Serialization.cs deleted file mode 100644 index a4372b8ff206..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class MeshRevisionProfileResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - MeshRevisionProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - MeshRevisionProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs deleted file mode 100644 index 349a3898fb10..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a MeshRevisionProfile along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetMeshRevisionProfileResource method. - /// Otherwise you can get one from its parent resource using the GetMeshRevisionProfile method. - /// - public partial class MeshRevisionProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The location. - /// The mode. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string mode) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _meshRevisionProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _meshRevisionProfileManagedClustersRestClient; - private readonly MeshRevisionProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/locations/meshRevisionProfiles"; - - /// Initializes a new instance of the class for mocking. - protected MeshRevisionProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal MeshRevisionProfileResource(ArmClient client, MeshRevisionProfileData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal MeshRevisionProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _meshRevisionProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string meshRevisionProfileManagedClustersApiVersion); - _meshRevisionProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, meshRevisionProfileManagedClustersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual MeshRevisionProfileData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileResource.Get"); - scope.Start(); - try - { - var response = await _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfileAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshRevisionProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _meshRevisionProfileManagedClustersClientDiagnostics.CreateScope("MeshRevisionProfileResource.Get"); - scope.Start(); - try - { - var response = _meshRevisionProfileManagedClustersRestClient.GetMeshRevisionProfile(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshRevisionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs deleted file mode 100644 index c9c2c819a366..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetMeshUpgradeProfiles method from an instance of . - /// - public partial class MeshUpgradeProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _meshUpgradeProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _meshUpgradeProfileManagedClustersRestClient; - - /// Initializes a new instance of the class for mocking. - protected MeshUpgradeProfileCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal MeshUpgradeProfileCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _meshUpgradeProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", MeshUpgradeProfileResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(MeshUpgradeProfileResource.ResourceType, out string meshUpgradeProfileManagedClustersApiVersion); - _meshUpgradeProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, meshUpgradeProfileManagedClustersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id)); - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.Get"); - scope.Start(); - try - { - var response = await _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.Get"); - scope.Start(); - try - { - var response = _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists available upgrades for all service meshes in a specific cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles - /// - /// - /// Operation Id - /// ManagedClusters_ListMeshUpgradeProfiles - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _meshUpgradeProfileManagedClustersRestClient.CreateListMeshUpgradeProfilesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _meshUpgradeProfileManagedClustersRestClient.CreateListMeshUpgradeProfilesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MeshUpgradeProfileResource(Client, MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(e)), _meshUpgradeProfileManagedClustersClientDiagnostics, Pipeline, "MeshUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists available upgrades for all service meshes in a specific cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles - /// - /// - /// Operation Id - /// ManagedClusters_ListMeshUpgradeProfiles - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _meshUpgradeProfileManagedClustersRestClient.CreateListMeshUpgradeProfilesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _meshUpgradeProfileManagedClustersRestClient.CreateListMeshUpgradeProfilesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MeshUpgradeProfileResource(Client, MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(e)), _meshUpgradeProfileManagedClustersClientDiagnostics, Pipeline, "MeshUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.Exists"); - scope.Start(); - try - { - var response = await _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.Exists"); - scope.Start(); - try - { - var response = _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The mode of the mesh. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileCollection.GetIfExists"); - scope.Start(); - try - { - var response = _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, mode, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.cs deleted file mode 100644 index be5fd3ed55d8..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the MeshUpgradeProfile data model. - /// Upgrade profile for given mesh. - /// - public partial class MeshUpgradeProfileData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public MeshUpgradeProfileData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Mesh upgrade profile properties for a major.minor release. - /// Keeps track of any properties unknown to the library. - internal MeshUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MeshUpgradeProfileProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Mesh upgrade profile properties for a major.minor release. - public MeshUpgradeProfileProperties Properties { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.Serialization.cs deleted file mode 100644 index 5bb3ba35e73b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class MeshUpgradeProfileResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - MeshUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - MeshUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs deleted file mode 100644 index 84cce4083213..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing a MeshUpgradeProfile along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetMeshUpgradeProfileResource method. - /// Otherwise you can get one from its parent resource using the GetMeshUpgradeProfile method. - /// - public partial class MeshUpgradeProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The resourceName. - /// The mode. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string mode) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _meshUpgradeProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _meshUpgradeProfileManagedClustersRestClient; - private readonly MeshUpgradeProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/meshUpgradeProfiles"; - - /// Initializes a new instance of the class for mocking. - protected MeshUpgradeProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal MeshUpgradeProfileResource(ArmClient client, MeshUpgradeProfileData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal MeshUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _meshUpgradeProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string meshUpgradeProfileManagedClustersApiVersion); - _meshUpgradeProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, meshUpgradeProfileManagedClustersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual MeshUpgradeProfileData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = await _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets available upgrades for a service mesh in a cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode} - /// - /// - /// Operation Id - /// ManagedClusters_GetMeshUpgradeProfile - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _meshUpgradeProfileManagedClustersClientDiagnostics.CreateScope("MeshUpgradeProfileResource.Get"); - scope.Start(); - try - { - var response = _meshUpgradeProfileManagedClustersRestClient.GetMeshUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MeshUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.Serialization.cs deleted file mode 100644 index debb21bbc958..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.Serialization.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class AgentPoolAvailableVersion : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolAvailableVersion)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsDefault)) - { - writer.WritePropertyName("default"u8); - writer.WriteBooleanValue(IsDefault.Value); - } - if (Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (Optional.IsDefined(IsPreview)) - { - writer.WritePropertyName("isPreview"u8); - writer.WriteBooleanValue(IsPreview.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolAvailableVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolAvailableVersion)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolAvailableVersion(document.RootElement, options); - } - - internal static AgentPoolAvailableVersion DeserializeAgentPoolAvailableVersion(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? @default = default; - string kubernetesVersion = default; - bool? isPreview = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("default"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - @default = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("isPreview"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolAvailableVersion(@default, kubernetesVersion, isPreview, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AgentPoolAvailableVersion)} does not support writing '{options.Format}' format."); - } - } - - AgentPoolAvailableVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolAvailableVersion(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolAvailableVersion)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.cs deleted file mode 100644 index bfcbf5310820..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersion.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The AgentPoolAvailableVersion. - public partial class AgentPoolAvailableVersion - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal AgentPoolAvailableVersion() - { - } - - /// Initializes a new instance of . - /// Whether this version is the default agent pool version. - /// The Kubernetes version (major.minor.patch). - /// Whether Kubernetes version is currently in preview. - /// Keeps track of any properties unknown to the library. - internal AgentPoolAvailableVersion(bool? isDefault, string kubernetesVersion, bool? isPreview, IDictionary serializedAdditionalRawData) - { - IsDefault = isDefault; - KubernetesVersion = kubernetesVersion; - IsPreview = isPreview; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether this version is the default agent pool version. - public bool? IsDefault { get; } - /// The Kubernetes version (major.minor.patch). - public string KubernetesVersion { get; } - /// Whether Kubernetes version is currently in preview. - public bool? IsPreview { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.Serialization.cs deleted file mode 100644 index 68ff3061b09f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.Serialization.cs +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class AgentPoolAvailableVersions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolAvailableVersions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(AgentPoolVersions)) - { - writer.WritePropertyName("agentPoolVersions"u8); - writer.WriteStartArray(); - foreach (var item in AgentPoolVersions) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolAvailableVersions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolAvailableVersions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolAvailableVersions(document.RootElement, options); - } - - internal static AgentPoolAvailableVersions DeserializeAgentPoolAvailableVersions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IReadOnlyList agentPoolVersions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("agentPoolVersions"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AgentPoolAvailableVersion.DeserializeAgentPoolAvailableVersion(item, options)); - } - agentPoolVersions = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolAvailableVersions( - id, - name, - type, - systemData, - agentPoolVersions ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AgentPoolAvailableVersions)} does not support writing '{options.Format}' format."); - } - } - - AgentPoolAvailableVersions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolAvailableVersions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolAvailableVersions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs deleted file mode 100644 index 70fc82018479..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The list of available versions for an agent pool. - public partial class AgentPoolAvailableVersions : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal AgentPoolAvailableVersions() - { - AgentPoolVersions = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// List of versions available for agent pool. - /// Keeps track of any properties unknown to the library. - internal AgentPoolAvailableVersions(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList agentPoolVersions, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - AgentPoolVersions = agentPoolVersions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of versions available for agent pool. - public IReadOnlyList AgentPoolVersions { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolMode.cs deleted file mode 100644 index d9ec3128623f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - public readonly partial struct AgentPoolMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AgentPoolMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SystemValue = "System"; - private const string UserValue = "User"; - - /// System agent pools are primarily for hosting critical system pods such as CoreDNS and metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at least 2vCPUs and 4GB of memory. - public static AgentPoolMode System { get; } = new AgentPoolMode(SystemValue); - /// User agent pools are primarily for hosting your application pods. - public static AgentPoolMode User { get; } = new AgentPoolMode(UserValue); - /// Determines if two values are the same. - public static bool operator ==(AgentPoolMode left, AgentPoolMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AgentPoolMode left, AgentPoolMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AgentPoolMode(string value) => new AgentPoolMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AgentPoolMode other && Equals(other); - /// - public bool Equals(AgentPoolMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortProtocol.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortProtocol.cs deleted file mode 100644 index 7015a8d66d5b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortProtocol.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The network protocol of the port. - public readonly partial struct AgentPoolNetworkPortProtocol : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AgentPoolNetworkPortProtocol(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TcpValue = "TCP"; - private const string UdpValue = "UDP"; - - /// TCP protocol. - public static AgentPoolNetworkPortProtocol Tcp { get; } = new AgentPoolNetworkPortProtocol(TcpValue); - /// UDP protocol. - public static AgentPoolNetworkPortProtocol Udp { get; } = new AgentPoolNetworkPortProtocol(UdpValue); - /// Determines if two values are the same. - public static bool operator ==(AgentPoolNetworkPortProtocol left, AgentPoolNetworkPortProtocol right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AgentPoolNetworkPortProtocol left, AgentPoolNetworkPortProtocol right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AgentPoolNetworkPortProtocol(string value) => new AgentPoolNetworkPortProtocol(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AgentPoolNetworkPortProtocol other && Equals(other); - /// - public bool Equals(AgentPoolNetworkPortProtocol other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.Serialization.cs deleted file mode 100644 index ce838b5bb951..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class AgentPoolNetworkPortRange : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolNetworkPortRange)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(PortStart)) - { - writer.WritePropertyName("portStart"u8); - writer.WriteNumberValue(PortStart.Value); - } - if (Optional.IsDefined(PortEnd)) - { - writer.WritePropertyName("portEnd"u8); - writer.WriteNumberValue(PortEnd.Value); - } - if (Optional.IsDefined(Protocol)) - { - writer.WritePropertyName("protocol"u8); - writer.WriteStringValue(Protocol.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolNetworkPortRange IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolNetworkPortRange)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolNetworkPortRange(document.RootElement, options); - } - - internal static AgentPoolNetworkPortRange DeserializeAgentPoolNetworkPortRange(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? portStart = default; - int? portEnd = default; - AgentPoolNetworkPortProtocol? protocol = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("portStart"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - portStart = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("portEnd"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - portEnd = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("protocol"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - protocol = new AgentPoolNetworkPortProtocol(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolNetworkPortRange(portStart, portEnd, protocol, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AgentPoolNetworkPortRange)} does not support writing '{options.Format}' format."); - } - } - - AgentPoolNetworkPortRange IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolNetworkPortRange(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolNetworkPortRange)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.cs deleted file mode 100644 index cf9faacf1bc1..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkPortRange.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The port range. - public partial class AgentPoolNetworkPortRange - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public AgentPoolNetworkPortRange() - { - } - - /// Initializes a new instance of . - /// The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. - /// The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. - /// The network protocol of the port. - /// Keeps track of any properties unknown to the library. - internal AgentPoolNetworkPortRange(int? portStart, int? portEnd, AgentPoolNetworkPortProtocol? protocol, IDictionary serializedAdditionalRawData) - { - PortStart = portStart; - PortEnd = portEnd; - Protocol = protocol; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. - public int? PortStart { get; set; } - /// The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. - public int? PortEnd { get; set; } - /// The network protocol of the port. - public AgentPoolNetworkPortProtocol? Protocol { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.Serialization.cs deleted file mode 100644 index aa9dfc668532..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.Serialization.cs +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class AgentPoolNetworkProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolNetworkProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(NodePublicIPTags)) - { - writer.WritePropertyName("nodePublicIPTags"u8); - writer.WriteStartArray(); - foreach (var item in NodePublicIPTags) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AllowedHostPorts)) - { - writer.WritePropertyName("allowedHostPorts"u8); - writer.WriteStartArray(); - foreach (var item in AllowedHostPorts) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ApplicationSecurityGroups)) - { - writer.WritePropertyName("applicationSecurityGroups"u8); - writer.WriteStartArray(); - foreach (var item in ApplicationSecurityGroups) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolNetworkProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolNetworkProfile(document.RootElement, options); - } - - internal static AgentPoolNetworkProfile DeserializeAgentPoolNetworkProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList nodePublicIPTags = default; - IList allowedHostPorts = default; - IList applicationSecurityGroups = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("nodePublicIPTags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceIPTag.DeserializeContainerServiceIPTag(item, options)); - } - nodePublicIPTags = array; - continue; - } - if (property.NameEquals("allowedHostPorts"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AgentPoolNetworkPortRange.DeserializeAgentPoolNetworkPortRange(item, options)); - } - allowedHostPorts = array; - continue; - } - if (property.NameEquals("applicationSecurityGroups"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - applicationSecurityGroups = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolNetworkProfile(nodePublicIPTags ?? new ChangeTrackingList(), allowedHostPorts ?? new ChangeTrackingList(), applicationSecurityGroups ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AgentPoolNetworkProfile)} does not support writing '{options.Format}' format."); - } - } - - AgentPoolNetworkProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolNetworkProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolNetworkProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.cs deleted file mode 100644 index 245e6defc854..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolNetworkProfile.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Network settings of an agent pool. - public partial class AgentPoolNetworkProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public AgentPoolNetworkProfile() - { - NodePublicIPTags = new ChangeTrackingList(); - AllowedHostPorts = new ChangeTrackingList(); - ApplicationSecurityGroups = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// IPTags of instance-level public IPs. - /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. - /// The IDs of the application security groups which agent pool will associate when created. - /// Keeps track of any properties unknown to the library. - internal AgentPoolNetworkProfile(IList nodePublicIPTags, IList allowedHostPorts, IList applicationSecurityGroups, IDictionary serializedAdditionalRawData) - { - NodePublicIPTags = nodePublicIPTags; - AllowedHostPorts = allowedHostPorts; - ApplicationSecurityGroups = applicationSecurityGroups; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// IPTags of instance-level public IPs. - public IList NodePublicIPTags { get; } - /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. - public IList AllowedHostPorts { get; } - /// The IDs of the application security groups which agent pool will associate when created. - public IList ApplicationSecurityGroups { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.Serialization.cs deleted file mode 100644 index 5cd447f28e24..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class AgentPoolSnapshotListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolSnapshotListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolSnapshotListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolSnapshotListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolSnapshotListResult(document.RootElement, options); - } - - internal static AgentPoolSnapshotListResult DeserializeAgentPoolSnapshotListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolSnapshotListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AgentPoolSnapshotListResult)} does not support writing '{options.Format}' format."); - } - } - - AgentPoolSnapshotListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolSnapshotListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolSnapshotListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolType.cs deleted file mode 100644 index b0ace433f7a1..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The type of Agent Pool. - public readonly partial struct AgentPoolType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AgentPoolType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string VirtualMachineScaleSetsValue = "VirtualMachineScaleSets"; - private const string AvailabilitySetValue = "AvailabilitySet"; - - /// Create an Agent Pool backed by a Virtual Machine Scale Set. - public static AgentPoolType VirtualMachineScaleSets { get; } = new AgentPoolType(VirtualMachineScaleSetsValue); - /// Use of this is strongly discouraged. - public static AgentPoolType AvailabilitySet { get; } = new AgentPoolType(AvailabilitySetValue); - /// Determines if two values are the same. - public static bool operator ==(AgentPoolType left, AgentPoolType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AgentPoolType left, AgentPoolType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AgentPoolType(string value) => new AgentPoolType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AgentPoolType other && Equals(other); - /// - public bool Equals(AgentPoolType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.Serialization.cs deleted file mode 100644 index edcf3036d837..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfilePropertiesUpgradesItem)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (Optional.IsDefined(IsPreview)) - { - writer.WritePropertyName("isPreview"u8); - writer.WriteBooleanValue(IsPreview.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AgentPoolUpgradeProfilePropertiesUpgradesItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfilePropertiesUpgradesItem)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolUpgradeProfilePropertiesUpgradesItem(document.RootElement, options); - } - - internal static AgentPoolUpgradeProfilePropertiesUpgradesItem DeserializeAgentPoolUpgradeProfilePropertiesUpgradesItem(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string kubernetesVersion = default; - bool? isPreview = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("isPreview"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolUpgradeProfilePropertiesUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfilePropertiesUpgradesItem)} does not support writing '{options.Format}' format."); - } - } - - AgentPoolUpgradeProfilePropertiesUpgradesItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolUpgradeProfilePropertiesUpgradesItem(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AgentPoolUpgradeProfilePropertiesUpgradesItem)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs deleted file mode 100644 index ca7703529aaa..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Settings for upgrading an agentpool. - public partial class AgentPoolUpgradeSettings - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public AgentPoolUpgradeSettings() - { - } - - /// Initializes a new instance of . - /// This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. - /// Keeps track of any properties unknown to the library. - internal AgentPoolUpgradeSettings(string maxSurge, int? drainTimeoutInMinutes, IDictionary serializedAdditionalRawData) - { - MaxSurge = maxSurge; - DrainTimeoutInMinutes = drainTimeoutInMinutes; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. - public string MaxSurge { get; set; } - /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. - public int? DrainTimeoutInMinutes { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.Serialization.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.Serialization.cs index a6c162f88f71..f9f82e55af7f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.Serialization.cs @@ -13,28 +13,28 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class AgentPoolUpgradeSettings : IUtf8JsonSerializable, IJsonModel + public partial class AgentProfile : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AgentPoolUpgradeSettings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AgentProfile)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(MaxSurge)) + if (Optional.IsDefined(SubnetId)) { - writer.WritePropertyName("maxSurge"u8); - writer.WriteStringValue(MaxSurge); + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); } - if (Optional.IsDefined(DrainTimeoutInMinutes)) + if (Optional.IsDefined(VmSize)) { - writer.WritePropertyName("drainTimeoutInMinutes"u8); - writer.WriteNumberValue(DrainTimeoutInMinutes.Value); + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteEndObject(); } - AgentPoolUpgradeSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AgentProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AgentPoolUpgradeSettings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AgentProfile)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAgentPoolUpgradeSettings(document.RootElement, options); + return DeserializeAgentProfile(document.RootElement, options); } - internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static AgentProfile DeserializeAgentProfile(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -74,24 +74,24 @@ internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(Jso { return null; } - string maxSurge = default; - int? drainTimeoutInMinutes = default; + ResourceIdentifier subnetId = default; + string vmSize = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("maxSurge"u8)) - { - maxSurge = property.Value.GetString(); - continue; - } - if (property.NameEquals("drainTimeoutInMinutes"u8)) + if (property.NameEquals("subnetId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - drainTimeoutInMinutes = property.Value.GetInt32(); + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); continue; } if (options.Format != "W") @@ -100,38 +100,38 @@ internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolUpgradeSettings(maxSurge, drainTimeoutInMinutes, serializedAdditionalRawData); + return new AgentProfile(subnetId, vmSize, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AgentPoolUpgradeSettings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AgentProfile)} does not support writing '{options.Format}' format."); } } - AgentPoolUpgradeSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AgentProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAgentPoolUpgradeSettings(document.RootElement, options); + return DeserializeAgentProfile(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AgentPoolUpgradeSettings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AgentProfile)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.cs similarity index 66% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.cs index ba4bc7caa1fc..30aaa0f63738 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSnapshotListResult.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentProfile.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - /// The response from the List Snapshots operation. - internal partial class AgentPoolSnapshotListResult + /// Agent profile for the Fleet hub. + public partial class AgentProfile { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,25 @@ internal partial class AgentPoolSnapshotListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal AgentPoolSnapshotListResult() + /// Initializes a new instance of . + public AgentProfile() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The list of snapshots. - /// The URL to get the next set of snapshot results. + /// Initializes a new instance of . + /// The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. + /// The virtual machine size of the Fleet hub. /// Keeps track of any properties unknown to the library. - internal AgentPoolSnapshotListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal AgentProfile(ResourceIdentifier subnetId, string vmSize, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + SubnetId = subnetId; + VmSize = vmSize; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of snapshots. - public IReadOnlyList Value { get; } - /// The URL to get the next set of snapshot results. - public string NextLink { get; } + /// The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. + public ResourceIdentifier SubnetId { get; set; } + /// The virtual machine size of the Fleet hub. + public string VmSize { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.Serialization.cs similarity index 63% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.Serialization.cs index 938a8e88d3d6..ae4661357a20 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.Serialization.cs @@ -13,23 +13,23 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class ClusterUpgradeSettings : IUtf8JsonSerializable, IJsonModel + internal partial class ApiServerAccessProfile : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ClusterUpgradeSettings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ApiServerAccessProfile)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(OverrideSettings)) + if (Optional.IsDefined(EnablePrivateCluster)) { - writer.WritePropertyName("overrideSettings"u8); - writer.WriteObjectValue(OverrideSettings, options); + writer.WritePropertyName("enablePrivateCluster"u8); + writer.WriteBooleanValue(EnablePrivateCluster.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -49,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteEndObject(); } - ClusterUpgradeSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ApiServerAccessProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ClusterUpgradeSettings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ApiServerAccessProfile)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeClusterUpgradeSettings(document.RootElement, options); + return DeserializeApiServerAccessProfile(document.RootElement, options); } - internal static ClusterUpgradeSettings DeserializeClusterUpgradeSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static ApiServerAccessProfile DeserializeApiServerAccessProfile(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,18 +69,18 @@ internal static ClusterUpgradeSettings DeserializeClusterUpgradeSettings(JsonEle { return null; } - UpgradeOverrideSettings overrideSettings = default; + bool? enablePrivateCluster = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("overrideSettings"u8)) + if (property.NameEquals("enablePrivateCluster"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - overrideSettings = UpgradeOverrideSettings.DeserializeUpgradeOverrideSettings(property.Value, options); + enablePrivateCluster = property.Value.GetBoolean(); continue; } if (options.Format != "W") @@ -89,38 +89,38 @@ internal static ClusterUpgradeSettings DeserializeClusterUpgradeSettings(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new ClusterUpgradeSettings(overrideSettings, serializedAdditionalRawData); + return new ApiServerAccessProfile(enablePrivateCluster, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ClusterUpgradeSettings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ApiServerAccessProfile)} does not support writing '{options.Format}' format."); } } - ClusterUpgradeSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ApiServerAccessProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeClusterUpgradeSettings(document.RootElement, options); + return DeserializeApiServerAccessProfile(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ClusterUpgradeSettings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ApiServerAccessProfile)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.cs similarity index 69% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.cs index 0786bda2e932..0c42b45bf909 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ApiServerAccessProfile.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Mesh revision profile properties for a mesh. - internal partial class MeshRevisionProfileProperties + /// Access profile for the Fleet hub API server. + internal partial class ApiServerAccessProfile { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,21 @@ internal partial class MeshRevisionProfileProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MeshRevisionProfileProperties() + /// Initializes a new instance of . + public ApiServerAccessProfile() { - MeshRevisions = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// + /// Initializes a new instance of . + /// Whether to create the Fleet hub as a private cluster or not. /// Keeps track of any properties unknown to the library. - internal MeshRevisionProfileProperties(IList meshRevisions, IDictionary serializedAdditionalRawData) + internal ApiServerAccessProfile(bool? enablePrivateCluster, IDictionary serializedAdditionalRawData) { - MeshRevisions = meshRevisions; + EnablePrivateCluster = enablePrivateCluster; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the mesh revisions. - public IList MeshRevisions { get; } + /// Whether to create the Fleet hub as a private cluster or not. + public bool? EnablePrivateCluster { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AutoScaleExpander.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AutoScaleExpander.cs deleted file mode 100644 index 50bab7257e5a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AutoScaleExpander.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. - public readonly partial struct AutoScaleExpander : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AutoScaleExpander(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LeastWasteValue = "least-waste"; - private const string MostPodsValue = "most-pods"; - private const string PriorityValue = "priority"; - private const string RandomValue = "random"; - - /// Selects the node group that will have the least idle CPU (if tied, unused memory) after scale-up. This is useful when you have different classes of nodes, for example, high CPU or high memory nodes, and only want to expand those when there are pending pods that need a lot of those resources. - public static AutoScaleExpander LeastWaste { get; } = new AutoScaleExpander(LeastWasteValue); - /// Selects the node group that would be able to schedule the most pods when scaling up. This is useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple smaller nodes at once. - public static AutoScaleExpander MostPods { get; } = new AutoScaleExpander(MostPodsValue); - /// Selects the node group that has the highest priority assigned by the user. It's configuration is described in more details [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md). - public static AutoScaleExpander Priority { get; } = new AutoScaleExpander(PriorityValue); - /// Used when you don't have a particular need for the node groups to scale differently. - public static AutoScaleExpander Random { get; } = new AutoScaleExpander(RandomValue); - /// Determines if two values are the same. - public static bool operator ==(AutoScaleExpander left, AutoScaleExpander right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AutoScaleExpander left, AutoScaleExpander right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AutoScaleExpander(string value) => new AutoScaleExpander(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AutoScaleExpander other && Equals(other); - /// - public bool Equals(AutoScaleExpander other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.Serialization.cs deleted file mode 100644 index 39c1ca88570a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ContainerServiceAgentPoolListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceAgentPoolListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceAgentPoolListResult(document.RootElement, options); - } - - internal static ContainerServiceAgentPoolListResult DeserializeContainerServiceAgentPoolListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceAgentPoolListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolListResult)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceAgentPoolListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceAgentPoolListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceAgentPoolListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.cs deleted file mode 100644 index ac8db1aae181..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceAgentPoolListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The response from the List Agent Pools operation. - internal partial class ContainerServiceAgentPoolListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ContainerServiceAgentPoolListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The list of agent pools. - /// The URL to get the next set of agent pool results. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceAgentPoolListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The list of agent pools. - public IReadOnlyList Value { get; } - /// The URL to get the next set of agent pool results. - public string NextLink { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.Serialization.cs deleted file mode 100644 index fe1469240101..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceDateSpan : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceDateSpan)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("start"u8); - writer.WriteStringValue(Start, "D"); - writer.WritePropertyName("end"u8); - writer.WriteStringValue(End, "D"); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceDateSpan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceDateSpan)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceDateSpan(document.RootElement, options); - } - - internal static ContainerServiceDateSpan DeserializeContainerServiceDateSpan(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DateTimeOffset start = default; - DateTimeOffset end = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("start"u8)) - { - start = property.Value.GetDateTimeOffset("D"); - continue; - } - if (property.NameEquals("end"u8)) - { - end = property.Value.GetDateTimeOffset("D"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceDateSpan(start, end, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceDateSpan)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceDateSpan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceDateSpan(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceDateSpan)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.cs deleted file mode 100644 index bb3e389db4ea..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceDateSpan.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For example, between '2022-12-23' and '2023-01-05'. - public partial class ContainerServiceDateSpan - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The start date of the date span. - /// The end date of the date span. - public ContainerServiceDateSpan(DateTimeOffset start, DateTimeOffset end) - { - Start = start; - End = end; - } - - /// Initializes a new instance of . - /// The start date of the date span. - /// The end date of the date span. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceDateSpan(DateTimeOffset start, DateTimeOffset end, IDictionary serializedAdditionalRawData) - { - Start = start; - End = end; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceDateSpan() - { - } - - /// The start date of the date span. - public DateTimeOffset Start { get; set; } - /// The end date of the date span. - public DateTimeOffset End { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.Serialization.cs deleted file mode 100644 index 561f24633a42..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceEndpointDependency : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceEndpointDependency)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(DomainName)) - { - writer.WritePropertyName("domainName"u8); - writer.WriteStringValue(DomainName); - } - if (Optional.IsCollectionDefined(EndpointDetails)) - { - writer.WritePropertyName("endpointDetails"u8); - writer.WriteStartArray(); - foreach (var item in EndpointDetails) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceEndpointDependency IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceEndpointDependency)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceEndpointDependency(document.RootElement, options); - } - - internal static ContainerServiceEndpointDependency DeserializeContainerServiceEndpointDependency(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string domainName = default; - IReadOnlyList endpointDetails = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("domainName"u8)) - { - domainName = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpointDetails"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceEndpointDetail.DeserializeContainerServiceEndpointDetail(item, options)); - } - endpointDetails = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceEndpointDependency(domainName, endpointDetails ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceEndpointDependency)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceEndpointDependency IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceEndpointDependency(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceEndpointDependency)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.Serialization.cs deleted file mode 100644 index 28f16a697ae0..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.Serialization.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Net; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceEndpointDetail : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceEndpointDetail)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IPAddress)) - { - writer.WritePropertyName("ipAddress"u8); - writer.WriteStringValue(IPAddress.ToString()); - } - if (Optional.IsDefined(Port)) - { - writer.WritePropertyName("port"u8); - writer.WriteNumberValue(Port.Value); - } - if (Optional.IsDefined(Protocol)) - { - writer.WritePropertyName("protocol"u8); - writer.WriteStringValue(Protocol); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceEndpointDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceEndpointDetail)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceEndpointDetail(document.RootElement, options); - } - - internal static ContainerServiceEndpointDetail DeserializeContainerServiceEndpointDetail(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IPAddress ipAddress = default; - int? port = default; - string protocol = default; - string description = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ipAddress"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ipAddress = IPAddress.Parse(property.Value.GetString()); - continue; - } - if (property.NameEquals("port"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - port = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("protocol"u8)) - { - protocol = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceEndpointDetail(ipAddress, port, protocol, description, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceEndpointDetail)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceEndpointDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceEndpointDetail(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceEndpointDetail)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.cs deleted file mode 100644 index a495c312f0cc..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDetail.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Net; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// connect information from the AKS agent nodes to a single endpoint. - public partial class ContainerServiceEndpointDetail - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ContainerServiceEndpointDetail() - { - } - - /// Initializes a new instance of . - /// An IP Address that Domain Name currently resolves to. - /// The port an endpoint is connected to. - /// The protocol used for connection. - /// Description of the detail. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceEndpointDetail(IPAddress ipAddress, int? port, string protocol, string description, IDictionary serializedAdditionalRawData) - { - IPAddress = ipAddress; - Port = port; - Protocol = protocol; - Description = description; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// An IP Address that Domain Name currently resolves to. - public IPAddress IPAddress { get; } - /// The port an endpoint is connected to. - public int? Port { get; } - /// The protocol used for connection. - public string Protocol { get; } - /// Description of the detail. - public string Description { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.Serialization.cs deleted file mode 100644 index fbe3d35785d3..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceLinuxProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceLinuxProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("adminUsername"u8); - writer.WriteStringValue(AdminUsername); - writer.WritePropertyName("ssh"u8); - writer.WriteObjectValue(Ssh, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceLinuxProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceLinuxProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceLinuxProfile(document.RootElement, options); - } - - internal static ContainerServiceLinuxProfile DeserializeContainerServiceLinuxProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string adminUsername = default; - ContainerServiceSshConfiguration ssh = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("adminUsername"u8)) - { - adminUsername = property.Value.GetString(); - continue; - } - if (property.NameEquals("ssh"u8)) - { - ssh = ContainerServiceSshConfiguration.DeserializeContainerServiceSshConfiguration(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceLinuxProfile(adminUsername, ssh, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceLinuxProfile)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceLinuxProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceLinuxProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceLinuxProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.cs deleted file mode 100644 index ee5d33902336..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLinuxProfile.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Profile for Linux VMs in the container service cluster. - public partial class ContainerServiceLinuxProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The administrator username to use for Linux VMs. - /// The SSH configuration for Linux-based VMs running on Azure. - /// or is null. - public ContainerServiceLinuxProfile(string adminUsername, ContainerServiceSshConfiguration ssh) - { - Argument.AssertNotNull(adminUsername, nameof(adminUsername)); - Argument.AssertNotNull(ssh, nameof(ssh)); - - AdminUsername = adminUsername; - Ssh = ssh; - } - - /// Initializes a new instance of . - /// The administrator username to use for Linux VMs. - /// The SSH configuration for Linux-based VMs running on Azure. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceLinuxProfile(string adminUsername, ContainerServiceSshConfiguration ssh, IDictionary serializedAdditionalRawData) - { - AdminUsername = adminUsername; - Ssh = ssh; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceLinuxProfile() - { - } - - /// The administrator username to use for Linux VMs. - public string AdminUsername { get; set; } - /// The SSH configuration for Linux-based VMs running on Azure. - internal ContainerServiceSshConfiguration Ssh { get; set; } - /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - public IList SshPublicKeys - { - get => Ssh is null ? default : Ssh.PublicKeys; - set => Ssh = new ContainerServiceSshConfiguration(value); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLoadBalancerSku.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLoadBalancerSku.cs deleted file mode 100644 index e842bc0491db..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceLoadBalancerSku.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. - public readonly partial struct ContainerServiceLoadBalancerSku : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceLoadBalancerSku(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string StandardValue = "standard"; - private const string BasicValue = "basic"; - - /// Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For more information about on working with the load balancer in the managed cluster, see the [standard Load Balancer](https://docs.microsoft.com/azure/aks/load-balancer-standard) article. - public static ContainerServiceLoadBalancerSku Standard { get; } = new ContainerServiceLoadBalancerSku(StandardValue); - /// Use a basic Load Balancer with limited functionality. - public static ContainerServiceLoadBalancerSku Basic { get; } = new ContainerServiceLoadBalancerSku(BasicValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceLoadBalancerSku left, ContainerServiceLoadBalancerSku right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceLoadBalancerSku left, ContainerServiceLoadBalancerSku right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceLoadBalancerSku(string value) => new ContainerServiceLoadBalancerSku(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceLoadBalancerSku other && Equals(other); - /// - public bool Equals(ContainerServiceLoadBalancerSku other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.Serialization.cs deleted file mode 100644 index 3e08472962ae..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceAbsoluteMonthlySchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceAbsoluteMonthlySchedule)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("intervalMonths"u8); - writer.WriteNumberValue(IntervalMonths); - writer.WritePropertyName("dayOfMonth"u8); - writer.WriteNumberValue(DayOfMonth); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceAbsoluteMonthlySchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceAbsoluteMonthlySchedule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceAbsoluteMonthlySchedule(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceAbsoluteMonthlySchedule DeserializeContainerServiceMaintenanceAbsoluteMonthlySchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int intervalMonths = default; - int dayOfMonth = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("intervalMonths"u8)) - { - intervalMonths = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("dayOfMonth"u8)) - { - dayOfMonth = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceMaintenanceAbsoluteMonthlySchedule(intervalMonths, dayOfMonth, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceAbsoluteMonthlySchedule)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceAbsoluteMonthlySchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceMaintenanceAbsoluteMonthlySchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceAbsoluteMonthlySchedule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.Serialization.cs deleted file mode 100644 index e02d52207f19..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ContainerServiceMaintenanceConfigurationListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceConfigurationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceConfigurationListResult DeserializeContainerServiceMaintenanceConfigurationListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceMaintenanceConfigurationListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationListResult)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceConfigurationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.Serialization.cs deleted file mode 100644 index 10bb03a4b647..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.Serialization.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceRelativeMonthlySchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceRelativeMonthlySchedule)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("intervalMonths"u8); - writer.WriteNumberValue(IntervalMonths); - writer.WritePropertyName("weekIndex"u8); - writer.WriteStringValue(WeekIndex.ToString()); - writer.WritePropertyName("dayOfWeek"u8); - writer.WriteStringValue(DayOfWeek.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceRelativeMonthlySchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceRelativeMonthlySchedule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceRelativeMonthlySchedule(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceRelativeMonthlySchedule DeserializeContainerServiceMaintenanceRelativeMonthlySchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int intervalMonths = default; - ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex weekIndex = default; - ContainerServiceWeekDay dayOfWeek = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("intervalMonths"u8)) - { - intervalMonths = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("weekIndex"u8)) - { - weekIndex = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(property.Value.GetString()); - continue; - } - if (property.NameEquals("dayOfWeek"u8)) - { - dayOfWeek = new ContainerServiceWeekDay(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceMaintenanceRelativeMonthlySchedule(intervalMonths, weekIndex, dayOfWeek, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceRelativeMonthlySchedule)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceRelativeMonthlySchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceMaintenanceRelativeMonthlySchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceRelativeMonthlySchedule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.cs deleted file mode 100644 index 1fc98121a4a2..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlySchedule.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. - public partial class ContainerServiceMaintenanceRelativeMonthlySchedule - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Specifies the number of months between each set of occurrences. - /// Specifies on which week of the month the dayOfWeek applies. - /// Specifies on which day of the week the maintenance occurs. - public ContainerServiceMaintenanceRelativeMonthlySchedule(int intervalMonths, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex weekIndex, ContainerServiceWeekDay dayOfWeek) - { - IntervalMonths = intervalMonths; - WeekIndex = weekIndex; - DayOfWeek = dayOfWeek; - } - - /// Initializes a new instance of . - /// Specifies the number of months between each set of occurrences. - /// Specifies on which week of the month the dayOfWeek applies. - /// Specifies on which day of the week the maintenance occurs. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceRelativeMonthlySchedule(int intervalMonths, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex weekIndex, ContainerServiceWeekDay dayOfWeek, IDictionary serializedAdditionalRawData) - { - IntervalMonths = intervalMonths; - WeekIndex = weekIndex; - DayOfWeek = dayOfWeek; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceMaintenanceRelativeMonthlySchedule() - { - } - - /// Specifies the number of months between each set of occurrences. - public int IntervalMonths { get; set; } - /// Specifies on which week of the month the dayOfWeek applies. - public ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex WeekIndex { get; set; } - /// Specifies on which day of the week the maintenance occurs. - public ContainerServiceWeekDay DayOfWeek { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.cs deleted file mode 100644 index afe32f5956f8..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Specifies on which week of the month the dayOfWeek applies. - public readonly partial struct ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string FirstValue = "First"; - private const string SecondValue = "Second"; - private const string ThirdValue = "Third"; - private const string FourthValue = "Fourth"; - private const string LastValue = "Last"; - - /// First week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex First { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(FirstValue); - /// Second week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex Second { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(SecondValue); - /// Third week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex Third { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(ThirdValue); - /// Fourth week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex Fourth { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(FourthValue); - /// Last week of the month. - public static ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex Last { get; } = new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(LastValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex left, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex left, ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(string value) => new ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex other && Equals(other); - /// - public bool Equals(ContainerServiceMaintenanceRelativeMonthlyScheduleWeekIndex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.Serialization.cs deleted file mode 100644 index 50d6e2d18ac4..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.Serialization.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceSchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceSchedule)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Daily)) - { - writer.WritePropertyName("daily"u8); - writer.WriteObjectValue(Daily, options); - } - if (Optional.IsDefined(Weekly)) - { - writer.WritePropertyName("weekly"u8); - writer.WriteObjectValue(Weekly, options); - } - if (Optional.IsDefined(AbsoluteMonthly)) - { - writer.WritePropertyName("absoluteMonthly"u8); - writer.WriteObjectValue(AbsoluteMonthly, options); - } - if (Optional.IsDefined(RelativeMonthly)) - { - writer.WritePropertyName("relativeMonthly"u8); - writer.WriteObjectValue(RelativeMonthly, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceSchedule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceSchedule(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceSchedule DeserializeContainerServiceMaintenanceSchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DailySchedule daily = default; - ContainerServiceMaintenanceWeeklySchedule weekly = default; - ContainerServiceMaintenanceAbsoluteMonthlySchedule absoluteMonthly = default; - ContainerServiceMaintenanceRelativeMonthlySchedule relativeMonthly = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("daily"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - daily = DailySchedule.DeserializeDailySchedule(property.Value, options); - continue; - } - if (property.NameEquals("weekly"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - weekly = ContainerServiceMaintenanceWeeklySchedule.DeserializeContainerServiceMaintenanceWeeklySchedule(property.Value, options); - continue; - } - if (property.NameEquals("absoluteMonthly"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - absoluteMonthly = ContainerServiceMaintenanceAbsoluteMonthlySchedule.DeserializeContainerServiceMaintenanceAbsoluteMonthlySchedule(property.Value, options); - continue; - } - if (property.NameEquals("relativeMonthly"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - relativeMonthly = ContainerServiceMaintenanceRelativeMonthlySchedule.DeserializeContainerServiceMaintenanceRelativeMonthlySchedule(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceMaintenanceSchedule(daily, weekly, absoluteMonthly, relativeMonthly, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceSchedule)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceSchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceMaintenanceSchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceSchedule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.cs deleted file mode 100644 index 059c591464bd..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceSchedule.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' for your maintenance schedule. - public partial class ContainerServiceMaintenanceSchedule - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ContainerServiceMaintenanceSchedule() - { - } - - /// Initializes a new instance of . - /// For schedules like: 'recur every day' or 'recur every 3 days'. - /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. - /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceSchedule(DailySchedule daily, ContainerServiceMaintenanceWeeklySchedule weekly, ContainerServiceMaintenanceAbsoluteMonthlySchedule absoluteMonthly, ContainerServiceMaintenanceRelativeMonthlySchedule relativeMonthly, IDictionary serializedAdditionalRawData) - { - Daily = daily; - Weekly = weekly; - AbsoluteMonthly = absoluteMonthly; - RelativeMonthly = relativeMonthly; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// For schedules like: 'recur every day' or 'recur every 3 days'. - internal DailySchedule Daily { get; set; } - /// Specifies the number of days between each set of occurrences. - public int? DailyIntervalDays - { - get => Daily is null ? default(int?) : Daily.IntervalDays; - set - { - Daily = value.HasValue ? new DailySchedule(value.Value) : null; - } - } - - /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - public ContainerServiceMaintenanceWeeklySchedule Weekly { get; set; } - /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. - public ContainerServiceMaintenanceAbsoluteMonthlySchedule AbsoluteMonthly { get; set; } - /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. - public ContainerServiceMaintenanceRelativeMonthlySchedule RelativeMonthly { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.Serialization.cs deleted file mode 100644 index 3bd6111fbe82..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceWeeklySchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWeeklySchedule)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("intervalWeeks"u8); - writer.WriteNumberValue(IntervalWeeks); - writer.WritePropertyName("dayOfWeek"u8); - writer.WriteStringValue(DayOfWeek.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceWeeklySchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWeeklySchedule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceWeeklySchedule(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceWeeklySchedule DeserializeContainerServiceMaintenanceWeeklySchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int intervalWeeks = default; - ContainerServiceWeekDay dayOfWeek = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("intervalWeeks"u8)) - { - intervalWeeks = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("dayOfWeek"u8)) - { - dayOfWeek = new ContainerServiceWeekDay(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceMaintenanceWeeklySchedule(intervalWeeks, dayOfWeek, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWeeklySchedule)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceWeeklySchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceMaintenanceWeeklySchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWeeklySchedule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.cs deleted file mode 100644 index 734353fd463f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWeeklySchedule.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - public partial class ContainerServiceMaintenanceWeeklySchedule - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Specifies the number of weeks between each set of occurrences. - /// Specifies on which day of the week the maintenance occurs. - public ContainerServiceMaintenanceWeeklySchedule(int intervalWeeks, ContainerServiceWeekDay dayOfWeek) - { - IntervalWeeks = intervalWeeks; - DayOfWeek = dayOfWeek; - } - - /// Initializes a new instance of . - /// Specifies the number of weeks between each set of occurrences. - /// Specifies on which day of the week the maintenance occurs. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceWeeklySchedule(int intervalWeeks, ContainerServiceWeekDay dayOfWeek, IDictionary serializedAdditionalRawData) - { - IntervalWeeks = intervalWeeks; - DayOfWeek = dayOfWeek; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceMaintenanceWeeklySchedule() - { - } - - /// Specifies the number of weeks between each set of occurrences. - public int IntervalWeeks { get; set; } - /// Specifies on which day of the week the maintenance occurs. - public ContainerServiceWeekDay DayOfWeek { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.Serialization.cs deleted file mode 100644 index 016ed4341de0..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.Serialization.cs +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceMaintenanceWindow : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWindow)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("schedule"u8); - writer.WriteObjectValue(Schedule, options); - writer.WritePropertyName("durationHours"u8); - writer.WriteNumberValue(DurationHours); - if (Optional.IsDefined(UtcOffset)) - { - writer.WritePropertyName("utcOffset"u8); - writer.WriteStringValue(UtcOffset); - } - if (Optional.IsDefined(StartDate)) - { - writer.WritePropertyName("startDate"u8); - writer.WriteStringValue(StartDate); - } - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartTime); - if (Optional.IsCollectionDefined(NotAllowedDates)) - { - writer.WritePropertyName("notAllowedDates"u8); - writer.WriteStartArray(); - foreach (var item in NotAllowedDates) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceMaintenanceWindow IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWindow)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceWindow(document.RootElement, options); - } - - internal static ContainerServiceMaintenanceWindow DeserializeContainerServiceMaintenanceWindow(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ContainerServiceMaintenanceSchedule schedule = default; - int durationHours = default; - string utcOffset = default; - string startDate = default; - string startTime = default; - IList notAllowedDates = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("schedule"u8)) - { - schedule = ContainerServiceMaintenanceSchedule.DeserializeContainerServiceMaintenanceSchedule(property.Value, options); - continue; - } - if (property.NameEquals("durationHours"u8)) - { - durationHours = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("utcOffset"u8)) - { - utcOffset = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDate"u8)) - { - startDate = property.Value.GetString(); - continue; - } - if (property.NameEquals("startTime"u8)) - { - startTime = property.Value.GetString(); - continue; - } - if (property.NameEquals("notAllowedDates"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceDateSpan.DeserializeContainerServiceDateSpan(item, options)); - } - notAllowedDates = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceMaintenanceWindow( - schedule, - durationHours, - utcOffset, - startDate, - startTime, - notAllowedDates ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWindow)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceMaintenanceWindow IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceMaintenanceWindow(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceWindow)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.cs deleted file mode 100644 index e31932d49669..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceWindow.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. - public partial class ContainerServiceMaintenanceWindow - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Recurrence schedule for the maintenance window. - /// Length of maintenance window range from 4 to 24 hours. - /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. - /// or is null. - public ContainerServiceMaintenanceWindow(ContainerServiceMaintenanceSchedule schedule, int durationHours, string startTime) - { - Argument.AssertNotNull(schedule, nameof(schedule)); - Argument.AssertNotNull(startTime, nameof(startTime)); - - Schedule = schedule; - DurationHours = durationHours; - StartTime = startTime; - NotAllowedDates = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Recurrence schedule for the maintenance window. - /// Length of maintenance window range from 4 to 24 hours. - /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'. - /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away. - /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. - /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceWindow(ContainerServiceMaintenanceSchedule schedule, int durationHours, string utcOffset, string startDate, string startTime, IList notAllowedDates, IDictionary serializedAdditionalRawData) - { - Schedule = schedule; - DurationHours = durationHours; - UtcOffset = utcOffset; - StartDate = startDate; - StartTime = startTime; - NotAllowedDates = notAllowedDates; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceMaintenanceWindow() - { - } - - /// Recurrence schedule for the maintenance window. - public ContainerServiceMaintenanceSchedule Schedule { get; set; } - /// Length of maintenance window range from 4 to 24 hours. - public int DurationHours { get; set; } - /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'. - public string UtcOffset { get; set; } - /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away. - public string StartDate { get; set; } - /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. - public string StartTime { get; set; } - /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. - public IList NotAllowedDates { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkMode.cs deleted file mode 100644 index 46b819ab9a5d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// This cannot be specified if networkPlugin is anything other than 'azure'. - public readonly partial struct ContainerServiceNetworkMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceNetworkMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TransparentValue = "transparent"; - private const string BridgeValue = "bridge"; - - /// No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure CNI. See [Transparent Mode](https://docs.microsoft.com/azure/aks/faq#transparent-mode) for more information. - public static ContainerServiceNetworkMode Transparent { get; } = new ContainerServiceNetworkMode(TransparentValue); - /// This is no longer supported. - public static ContainerServiceNetworkMode Bridge { get; } = new ContainerServiceNetworkMode(BridgeValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceNetworkMode left, ContainerServiceNetworkMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceNetworkMode left, ContainerServiceNetworkMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceNetworkMode(string value) => new ContainerServiceNetworkMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceNetworkMode other && Equals(other); - /// - public bool Equals(ContainerServiceNetworkMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPlugin.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPlugin.cs deleted file mode 100644 index c51a57c7586c..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPlugin.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Network plugin used for building the Kubernetes network. - public readonly partial struct ContainerServiceNetworkPlugin : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceNetworkPlugin(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureValue = "azure"; - private const string KubenetValue = "kubenet"; - private const string NoneValue = "none"; - - /// Use the Azure CNI network plugin. See [Azure CNI (advanced) networking](https://docs.microsoft.com/azure/aks/concepts-network#azure-cni-advanced-networking) for more information. - public static ContainerServiceNetworkPlugin Azure { get; } = new ContainerServiceNetworkPlugin(AzureValue); - /// Use the Kubenet network plugin. See [Kubenet (basic) networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) for more information. - public static ContainerServiceNetworkPlugin Kubenet { get; } = new ContainerServiceNetworkPlugin(KubenetValue); - /// No CNI plugin is pre-installed. See [BYO CNI](https://docs.microsoft.com/en-us/azure/aks/use-byo-cni) for more information. - public static ContainerServiceNetworkPlugin None { get; } = new ContainerServiceNetworkPlugin(NoneValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceNetworkPlugin left, ContainerServiceNetworkPlugin right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceNetworkPlugin left, ContainerServiceNetworkPlugin right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceNetworkPlugin(string value) => new ContainerServiceNetworkPlugin(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceNetworkPlugin other && Equals(other); - /// - public bool Equals(ContainerServiceNetworkPlugin other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPluginMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPluginMode.cs deleted file mode 100644 index fa58e8f889fc..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPluginMode.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The mode the network plugin should use. - public readonly partial struct ContainerServiceNetworkPluginMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceNetworkPluginMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OverlayValue = "overlay"; - - /// Used with networkPlugin=azure, pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than Kubenet's method of route tables. For more information visit https://aka.ms/aks/azure-cni-overlay. - public static ContainerServiceNetworkPluginMode Overlay { get; } = new ContainerServiceNetworkPluginMode(OverlayValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceNetworkPluginMode left, ContainerServiceNetworkPluginMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceNetworkPluginMode left, ContainerServiceNetworkPluginMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceNetworkPluginMode(string value) => new ContainerServiceNetworkPluginMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceNetworkPluginMode other && Equals(other); - /// - public bool Equals(ContainerServiceNetworkPluginMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs deleted file mode 100644 index 5cce744538a0..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Network policy used for building the Kubernetes network. - public readonly partial struct ContainerServiceNetworkPolicy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceNetworkPolicy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CalicoValue = "calico"; - private const string AzureValue = "azure"; - private const string CiliumValue = "cilium"; - - /// Use Calico network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) for more information. - public static ContainerServiceNetworkPolicy Calico { get; } = new ContainerServiceNetworkPolicy(CalicoValue); - /// Use Azure network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) for more information. - public static ContainerServiceNetworkPolicy Azure { get; } = new ContainerServiceNetworkPolicy(AzureValue); - /// Use Cilium to enforce network policies. This requires networkDataplane to be 'cilium'. - public static ContainerServiceNetworkPolicy Cilium { get; } = new ContainerServiceNetworkPolicy(CiliumValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceNetworkPolicy left, ContainerServiceNetworkPolicy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceNetworkPolicy left, ContainerServiceNetworkPolicy right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceNetworkPolicy(string value) => new ContainerServiceNetworkPolicy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceNetworkPolicy other && Equals(other); - /// - public bool Equals(ContainerServiceNetworkPolicy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs deleted file mode 100644 index fa08610cfae2..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceNetworkProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceNetworkProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(NetworkPlugin)) - { - writer.WritePropertyName("networkPlugin"u8); - writer.WriteStringValue(NetworkPlugin.Value.ToString()); - } - if (Optional.IsDefined(NetworkPluginMode)) - { - writer.WritePropertyName("networkPluginMode"u8); - writer.WriteStringValue(NetworkPluginMode.Value.ToString()); - } - if (Optional.IsDefined(NetworkPolicy)) - { - writer.WritePropertyName("networkPolicy"u8); - writer.WriteStringValue(NetworkPolicy.Value.ToString()); - } - if (Optional.IsDefined(NetworkMode)) - { - writer.WritePropertyName("networkMode"u8); - writer.WriteStringValue(NetworkMode.Value.ToString()); - } - if (Optional.IsDefined(NetworkDataplane)) - { - writer.WritePropertyName("networkDataplane"u8); - writer.WriteStringValue(NetworkDataplane.Value.ToString()); - } - if (Optional.IsDefined(PodCidr)) - { - writer.WritePropertyName("podCidr"u8); - writer.WriteStringValue(PodCidr); - } - if (Optional.IsDefined(ServiceCidr)) - { - writer.WritePropertyName("serviceCidr"u8); - writer.WriteStringValue(ServiceCidr); - } - if (Optional.IsDefined(DnsServiceIP)) - { - writer.WritePropertyName("dnsServiceIP"u8); - writer.WriteStringValue(DnsServiceIP); - } - if (Optional.IsDefined(OutboundType)) - { - writer.WritePropertyName("outboundType"u8); - writer.WriteStringValue(OutboundType.Value.ToString()); - } - if (Optional.IsDefined(LoadBalancerSku)) - { - writer.WritePropertyName("loadBalancerSku"u8); - writer.WriteStringValue(LoadBalancerSku.Value.ToString()); - } - if (Optional.IsDefined(LoadBalancerProfile)) - { - writer.WritePropertyName("loadBalancerProfile"u8); - writer.WriteObjectValue(LoadBalancerProfile, options); - } - if (Optional.IsDefined(NatGatewayProfile)) - { - writer.WritePropertyName("natGatewayProfile"u8); - writer.WriteObjectValue(NatGatewayProfile, options); - } - if (Optional.IsCollectionDefined(PodCidrs)) - { - writer.WritePropertyName("podCidrs"u8); - writer.WriteStartArray(); - foreach (var item in PodCidrs) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ServiceCidrs)) - { - writer.WritePropertyName("serviceCidrs"u8); - writer.WriteStartArray(); - foreach (var item in ServiceCidrs) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(IPFamilies)) - { - writer.WritePropertyName("ipFamilies"u8); - writer.WriteStartArray(); - foreach (var item in IPFamilies) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceNetworkProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceNetworkProfile(document.RootElement, options); - } - - internal static ContainerServiceNetworkProfile DeserializeContainerServiceNetworkProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ContainerServiceNetworkPlugin? networkPlugin = default; - ContainerServiceNetworkPluginMode? networkPluginMode = default; - ContainerServiceNetworkPolicy? networkPolicy = default; - ContainerServiceNetworkMode? networkMode = default; - NetworkDataplane? networkDataplane = default; - string podCidr = default; - string serviceCidr = default; - string dnsServiceIP = default; - ContainerServiceOutboundType? outboundType = default; - ContainerServiceLoadBalancerSku? loadBalancerSku = default; - ManagedClusterLoadBalancerProfile loadBalancerProfile = default; - ManagedClusterNatGatewayProfile natGatewayProfile = default; - IList podCidrs = default; - IList serviceCidrs = default; - IList ipFamilies = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("networkPlugin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkPlugin = new ContainerServiceNetworkPlugin(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkPluginMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkPluginMode = new ContainerServiceNetworkPluginMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkPolicy = new ContainerServiceNetworkPolicy(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkMode = new ContainerServiceNetworkMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkDataplane"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkDataplane = new NetworkDataplane(property.Value.GetString()); - continue; - } - if (property.NameEquals("podCidr"u8)) - { - podCidr = property.Value.GetString(); - continue; - } - if (property.NameEquals("serviceCidr"u8)) - { - serviceCidr = property.Value.GetString(); - continue; - } - if (property.NameEquals("dnsServiceIP"u8)) - { - dnsServiceIP = property.Value.GetString(); - continue; - } - if (property.NameEquals("outboundType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - outboundType = new ContainerServiceOutboundType(property.Value.GetString()); - continue; - } - if (property.NameEquals("loadBalancerSku"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - loadBalancerSku = new ContainerServiceLoadBalancerSku(property.Value.GetString()); - continue; - } - if (property.NameEquals("loadBalancerProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - loadBalancerProfile = ManagedClusterLoadBalancerProfile.DeserializeManagedClusterLoadBalancerProfile(property.Value, options); - continue; - } - if (property.NameEquals("natGatewayProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - natGatewayProfile = ManagedClusterNatGatewayProfile.DeserializeManagedClusterNatGatewayProfile(property.Value, options); - continue; - } - if (property.NameEquals("podCidrs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - podCidrs = array; - continue; - } - if (property.NameEquals("serviceCidrs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - serviceCidrs = array; - continue; - } - if (property.NameEquals("ipFamilies"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new IPFamily(item.GetString())); - } - ipFamilies = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceNetworkProfile( - networkPlugin, - networkPluginMode, - networkPolicy, - networkMode, - networkDataplane, - podCidr, - serviceCidr, - dnsServiceIP, - outboundType, - loadBalancerSku, - loadBalancerProfile, - natGatewayProfile, - podCidrs ?? new ChangeTrackingList(), - serviceCidrs ?? new ChangeTrackingList(), - ipFamilies ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceNetworkProfile)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceNetworkProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceNetworkProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceNetworkProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs deleted file mode 100644 index e7c326996eae..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Profile of network configuration. - public partial class ContainerServiceNetworkProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ContainerServiceNetworkProfile() - { - PodCidrs = new ChangeTrackingList(); - ServiceCidrs = new ChangeTrackingList(); - IPFamilies = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Network plugin used for building the Kubernetes network. - /// The mode the network plugin should use. - /// Network policy used for building the Kubernetes network. - /// This cannot be specified if networkPlugin is anything other than 'azure'. - /// Network dataplane used in the Kubernetes cluster. - /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. - /// A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - /// An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). - /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. - /// Profile of the cluster load balancer. - /// Profile of the cluster NAT gateway. - /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. - /// IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceNetworkProfile(ContainerServiceNetworkPlugin? networkPlugin, ContainerServiceNetworkPluginMode? networkPluginMode, ContainerServiceNetworkPolicy? networkPolicy, ContainerServiceNetworkMode? networkMode, NetworkDataplane? networkDataplane, string podCidr, string serviceCidr, string dnsServiceIP, ContainerServiceOutboundType? outboundType, ContainerServiceLoadBalancerSku? loadBalancerSku, ManagedClusterLoadBalancerProfile loadBalancerProfile, ManagedClusterNatGatewayProfile natGatewayProfile, IList podCidrs, IList serviceCidrs, IList ipFamilies, IDictionary serializedAdditionalRawData) - { - NetworkPlugin = networkPlugin; - NetworkPluginMode = networkPluginMode; - NetworkPolicy = networkPolicy; - NetworkMode = networkMode; - NetworkDataplane = networkDataplane; - PodCidr = podCidr; - ServiceCidr = serviceCidr; - DnsServiceIP = dnsServiceIP; - OutboundType = outboundType; - LoadBalancerSku = loadBalancerSku; - LoadBalancerProfile = loadBalancerProfile; - NatGatewayProfile = natGatewayProfile; - PodCidrs = podCidrs; - ServiceCidrs = serviceCidrs; - IPFamilies = ipFamilies; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Network plugin used for building the Kubernetes network. - public ContainerServiceNetworkPlugin? NetworkPlugin { get; set; } - /// The mode the network plugin should use. - public ContainerServiceNetworkPluginMode? NetworkPluginMode { get; set; } - /// Network policy used for building the Kubernetes network. - public ContainerServiceNetworkPolicy? NetworkPolicy { get; set; } - /// This cannot be specified if networkPlugin is anything other than 'azure'. - public ContainerServiceNetworkMode? NetworkMode { get; set; } - /// Network dataplane used in the Kubernetes cluster. - public NetworkDataplane? NetworkDataplane { get; set; } - /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. - public string PodCidr { get; set; } - /// A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - public string ServiceCidr { get; set; } - /// An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - public string DnsServiceIP { get; set; } - /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). - public ContainerServiceOutboundType? OutboundType { get; set; } - /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. - public ContainerServiceLoadBalancerSku? LoadBalancerSku { get; set; } - /// Profile of the cluster load balancer. - public ManagedClusterLoadBalancerProfile LoadBalancerProfile { get; set; } - /// Profile of the cluster NAT gateway. - public ManagedClusterNatGatewayProfile NatGatewayProfile { get; set; } - /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - public IList PodCidrs { get; } - /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. - public IList ServiceCidrs { get; } - /// IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. - public IList IPFamilies { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSDiskType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSDiskType.cs deleted file mode 100644 index 272716714cec..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSDiskType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - public readonly partial struct ContainerServiceOSDiskType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceOSDiskType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ManagedValue = "Managed"; - private const string EphemeralValue = "Ephemeral"; - - /// Azure replicates the operating system disk for a virtual machine to Azure storage to avoid data loss should the VM need to be relocated to another host. Since containers aren't designed to have local state persisted, this behavior offers limited value while providing some drawbacks, including slower node provisioning and higher read/write latency. - public static ContainerServiceOSDiskType Managed { get; } = new ContainerServiceOSDiskType(ManagedValue); - /// Ephemeral OS disks are stored only on the host machine, just like a temporary disk. This provides lower read/write latency, along with faster node scaling and cluster upgrades. - public static ContainerServiceOSDiskType Ephemeral { get; } = new ContainerServiceOSDiskType(EphemeralValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceOSDiskType left, ContainerServiceOSDiskType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceOSDiskType left, ContainerServiceOSDiskType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceOSDiskType(string value) => new ContainerServiceOSDiskType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceOSDiskType other && Equals(other); - /// - public bool Equals(ContainerServiceOSDiskType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs deleted file mode 100644 index 395f4b9fa3c7..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceOSOptionProperty : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("os-type"u8); - writer.WriteStringValue(OSType); - writer.WritePropertyName("enable-fips-image"u8); - writer.WriteBooleanValue(EnableFipsImage); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceOSOptionProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceOSOptionProperty(document.RootElement, options); - } - - internal static ContainerServiceOSOptionProperty DeserializeContainerServiceOSOptionProperty(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string osType = default; - bool enableFipsImage = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("os-type"u8)) - { - osType = property.Value.GetString(); - continue; - } - if (property.NameEquals("enable-fips-image"u8)) - { - enableFipsImage = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceOSOptionProperty(osType, enableFipsImage, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceOSOptionProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceOSOptionProperty(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs deleted file mode 100644 index 7525edf3967b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSSku.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - public readonly partial struct ContainerServiceOSSku : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceOSSku(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UbuntuValue = "Ubuntu"; - private const string AzureLinuxValue = "AzureLinux"; - private const string CblMarinerValue = "CBLMariner"; - private const string Windows2019Value = "Windows2019"; - private const string Windows2022Value = "Windows2022"; - - /// Use Ubuntu as the OS for node images. - public static ContainerServiceOSSku Ubuntu { get; } = new ContainerServiceOSSku(UbuntuValue); - /// Use AzureLinux as the OS for node images. Azure Linux is a container-optimized Linux distro built by Microsoft, visit https://aka.ms/azurelinux for more information. - public static ContainerServiceOSSku AzureLinux { get; } = new ContainerServiceOSSku(AzureLinuxValue); - /// Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead. - public static ContainerServiceOSSku CblMariner { get; } = new ContainerServiceOSSku(CblMarinerValue); - /// Use Windows2019 as the OS for node images. Unsupported for system node pools. Windows2019 only supports Windows2019 containers; it cannot run Windows2022 containers and vice versa. - public static ContainerServiceOSSku Windows2019 { get; } = new ContainerServiceOSSku(Windows2019Value); - /// Use Windows2022 as the OS for node images. Unsupported for system node pools. Windows2022 only supports Windows2022 containers; it cannot run Windows2019 containers and vice versa. - public static ContainerServiceOSSku Windows2022 { get; } = new ContainerServiceOSSku(Windows2022Value); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceOSSku left, ContainerServiceOSSku right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceOSSku left, ContainerServiceOSSku right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceOSSku(string value) => new ContainerServiceOSSku(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceOSSku other && Equals(other); - /// - public bool Equals(ContainerServiceOSSku other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSType.cs deleted file mode 100644 index 87b0f4fa244c..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The operating system type. The default is Linux. - public readonly partial struct ContainerServiceOSType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceOSType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LinuxValue = "Linux"; - private const string WindowsValue = "Windows"; - - /// Use Linux. - public static ContainerServiceOSType Linux { get; } = new ContainerServiceOSType(LinuxValue); - /// Use Windows. - public static ContainerServiceOSType Windows { get; } = new ContainerServiceOSType(WindowsValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceOSType left, ContainerServiceOSType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceOSType left, ContainerServiceOSType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceOSType(string value) => new ContainerServiceOSType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceOSType other && Equals(other); - /// - public bool Equals(ContainerServiceOSType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.Serialization.cs deleted file mode 100644 index 2d2e8f0a9059..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceOutboundEnvironmentEndpoint : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceOutboundEnvironmentEndpoint)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Category)) - { - writer.WritePropertyName("category"u8); - writer.WriteStringValue(Category); - } - if (Optional.IsCollectionDefined(Endpoints)) - { - writer.WritePropertyName("endpoints"u8); - writer.WriteStartArray(); - foreach (var item in Endpoints) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceOutboundEnvironmentEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceOutboundEnvironmentEndpoint)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceOutboundEnvironmentEndpoint(document.RootElement, options); - } - - internal static ContainerServiceOutboundEnvironmentEndpoint DeserializeContainerServiceOutboundEnvironmentEndpoint(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string category = default; - IReadOnlyList endpoints = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("category"u8)) - { - category = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpoints"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceEndpointDependency.DeserializeContainerServiceEndpointDependency(item, options)); - } - endpoints = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceOutboundEnvironmentEndpoint(category, endpoints ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceOutboundEnvironmentEndpoint)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceOutboundEnvironmentEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceOutboundEnvironmentEndpoint(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceOutboundEnvironmentEndpoint)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.cs deleted file mode 100644 index 2a7921225456..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundEnvironmentEndpoint.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Egress endpoints which AKS agent nodes connect to for common purpose. - public partial class ContainerServiceOutboundEnvironmentEndpoint - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ContainerServiceOutboundEnvironmentEndpoint() - { - Endpoints = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - /// The endpoints that AKS agent nodes connect to. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceOutboundEnvironmentEndpoint(string category, IReadOnlyList endpoints, IDictionary serializedAdditionalRawData) - { - Category = category; - Endpoints = endpoints; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. - public string Category { get; } - /// The endpoints that AKS agent nodes connect to. - public IReadOnlyList Endpoints { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs deleted file mode 100644 index ea0558c2ea9b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOutboundType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). - public readonly partial struct ContainerServiceOutboundType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceOutboundType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LoadBalancerValue = "loadBalancer"; - private const string UserDefinedRoutingValue = "userDefinedRouting"; - private const string ManagedNatGatewayValue = "managedNATGateway"; - private const string UserAssignedNatGatewayValue = "userAssignedNATGateway"; - - /// The load balancer is used for egress through an AKS assigned public IP. This supports Kubernetes services of type 'loadBalancer'. For more information see [outbound type loadbalancer](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-loadbalancer). - public static ContainerServiceOutboundType LoadBalancer { get; } = new ContainerServiceOutboundType(LoadBalancerValue); - /// Egress paths must be defined by the user. This is an advanced scenario and requires proper network configuration. For more information see [outbound type userDefinedRouting](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-userdefinedrouting). - public static ContainerServiceOutboundType UserDefinedRouting { get; } = new ContainerServiceOutboundType(UserDefinedRoutingValue); - /// The AKS-managed NAT gateway is used for egress. - public static ContainerServiceOutboundType ManagedNatGateway { get; } = new ContainerServiceOutboundType(ManagedNatGatewayValue); - /// The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an advanced scenario and requires proper network configuration. - public static ContainerServiceOutboundType UserAssignedNatGateway { get; } = new ContainerServiceOutboundType(UserAssignedNatGatewayValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceOutboundType left, ContainerServiceOutboundType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceOutboundType left, ContainerServiceOutboundType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceOutboundType(string value) => new ContainerServiceOutboundType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceOutboundType other && Equals(other); - /// - public bool Equals(ContainerServiceOutboundType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.Serialization.cs deleted file mode 100644 index d99a06d96022..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ContainerServicePrivateEndpointConnectionListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServicePrivateEndpointConnectionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateEndpointConnectionListResult(document.RootElement, options); - } - - internal static ContainerServicePrivateEndpointConnectionListResult DeserializeContainerServicePrivateEndpointConnectionListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServicePrivateEndpointConnectionListResult(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionListResult)} does not support writing '{options.Format}' format."); - } - } - - ContainerServicePrivateEndpointConnectionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServicePrivateEndpointConnectionListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateEndpointConnectionListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.cs deleted file mode 100644 index a65b7387005d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionListResult.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// A list of private endpoint connections. - internal partial class ContainerServicePrivateEndpointConnectionListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ContainerServicePrivateEndpointConnectionListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The collection value. - /// Keeps track of any properties unknown to the library. - internal ContainerServicePrivateEndpointConnectionListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The collection value. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionProvisioningState.cs deleted file mode 100644 index 2d77880b76b3..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateEndpointConnectionProvisioningState.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The current provisioning state. - public readonly partial struct ContainerServicePrivateEndpointConnectionProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServicePrivateEndpointConnectionProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CanceledValue = "Canceled"; - private const string CreatingValue = "Creating"; - private const string DeletingValue = "Deleting"; - private const string FailedValue = "Failed"; - private const string SucceededValue = "Succeeded"; - - /// Canceled. - public static ContainerServicePrivateEndpointConnectionProvisioningState Canceled { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(CanceledValue); - /// Creating. - public static ContainerServicePrivateEndpointConnectionProvisioningState Creating { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(CreatingValue); - /// Deleting. - public static ContainerServicePrivateEndpointConnectionProvisioningState Deleting { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(DeletingValue); - /// Failed. - public static ContainerServicePrivateEndpointConnectionProvisioningState Failed { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(FailedValue); - /// Succeeded. - public static ContainerServicePrivateEndpointConnectionProvisioningState Succeeded { get; } = new ContainerServicePrivateEndpointConnectionProvisioningState(SucceededValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServicePrivateEndpointConnectionProvisioningState left, ContainerServicePrivateEndpointConnectionProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServicePrivateEndpointConnectionProvisioningState left, ContainerServicePrivateEndpointConnectionProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServicePrivateEndpointConnectionProvisioningState(string value) => new ContainerServicePrivateEndpointConnectionProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServicePrivateEndpointConnectionProvisioningState other && Equals(other); - /// - public bool Equals(ContainerServicePrivateEndpointConnectionProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.Serialization.cs deleted file mode 100644 index 808f82030bb1..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.Serialization.cs +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServicePrivateLinkResourceData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourceData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(ResourceType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType.Value); - } - if (Optional.IsDefined(GroupId)) - { - writer.WritePropertyName("groupId"u8); - writer.WriteStringValue(GroupId); - } - if (Optional.IsCollectionDefined(RequiredMembers)) - { - writer.WritePropertyName("requiredMembers"u8); - writer.WriteStartArray(); - foreach (var item in RequiredMembers) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(PrivateLinkServiceId)) - { - writer.WritePropertyName("privateLinkServiceID"u8); - writer.WriteStringValue(PrivateLinkServiceId); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServicePrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourceData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateLinkResourceData(document.RootElement, options); - } - - internal static ContainerServicePrivateLinkResourceData DeserializeContainerServicePrivateLinkResourceData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType? type = default; - string groupId = default; - IList requiredMembers = default; - ResourceIdentifier privateLinkServiceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("groupId"u8)) - { - groupId = property.Value.GetString(); - continue; - } - if (property.NameEquals("requiredMembers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - requiredMembers = array; - continue; - } - if (property.NameEquals("privateLinkServiceID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - privateLinkServiceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServicePrivateLinkResourceData( - id, - name, - type, - groupId, - requiredMembers ?? new ChangeTrackingList(), - privateLinkServiceId, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourceData)} does not support writing '{options.Format}' format."); - } - } - - ContainerServicePrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServicePrivateLinkResourceData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourceData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.cs deleted file mode 100644 index 8793a4482917..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourceData.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// A private link resource. - public partial class ContainerServicePrivateLinkResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ContainerServicePrivateLinkResourceData() - { - RequiredMembers = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The ID of the private link resource. - /// The name of the private link resource. - /// The resource type. - /// The group ID of the resource. - /// The RequiredMembers of the resource. - /// The private link service ID of the resource, this field is exposed only to NRP internally. - /// Keeps track of any properties unknown to the library. - internal ContainerServicePrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType? resourceType, string groupId, IList requiredMembers, ResourceIdentifier privateLinkServiceId, IDictionary serializedAdditionalRawData) - { - Id = id; - Name = name; - ResourceType = resourceType; - GroupId = groupId; - RequiredMembers = requiredMembers; - PrivateLinkServiceId = privateLinkServiceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The ID of the private link resource. - public ResourceIdentifier Id { get; set; } - /// The name of the private link resource. - public string Name { get; set; } - /// The resource type. - public ResourceType? ResourceType { get; set; } - /// The group ID of the resource. - public string GroupId { get; set; } - /// The RequiredMembers of the resource. - public IList RequiredMembers { get; } - /// The private link service ID of the resource, this field is exposed only to NRP internally. - public ResourceIdentifier PrivateLinkServiceId { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.Serialization.cs deleted file mode 100644 index 356e12c0a83b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ContainerServicePrivateLinkResourcesListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourcesListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServicePrivateLinkResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourcesListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateLinkResourcesListResult(document.RootElement, options); - } - - internal static ContainerServicePrivateLinkResourcesListResult DeserializeContainerServicePrivateLinkResourcesListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServicePrivateLinkResourcesListResult(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourcesListResult)} does not support writing '{options.Format}' format."); - } - } - - ContainerServicePrivateLinkResourcesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServicePrivateLinkResourcesListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkResourcesListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.cs deleted file mode 100644 index 4d296de64ce4..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkResourcesListResult.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// A list of private link resources. - internal partial class ContainerServicePrivateLinkResourcesListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ContainerServicePrivateLinkResourcesListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The collection value. - /// Keeps track of any properties unknown to the library. - internal ContainerServicePrivateLinkResourcesListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The collection value. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.Serialization.cs deleted file mode 100644 index cbe71d538672..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServicePrivateLinkServiceConnectionState : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkServiceConnectionState)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServicePrivateLinkServiceConnectionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkServiceConnectionState)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePrivateLinkServiceConnectionState(document.RootElement, options); - } - - internal static ContainerServicePrivateLinkServiceConnectionState DeserializeContainerServicePrivateLinkServiceConnectionState(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ContainerServicePrivateLinkServiceConnectionStatus? status = default; - string description = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new ContainerServicePrivateLinkServiceConnectionStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServicePrivateLinkServiceConnectionState(status, description, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkServiceConnectionState)} does not support writing '{options.Format}' format."); - } - } - - ContainerServicePrivateLinkServiceConnectionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServicePrivateLinkServiceConnectionState(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServicePrivateLinkServiceConnectionState)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionStatus.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionStatus.cs deleted file mode 100644 index 4e260f7cf3f7..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionStatus.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The private link service connection status. - public readonly partial struct ContainerServicePrivateLinkServiceConnectionStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServicePrivateLinkServiceConnectionStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PendingValue = "Pending"; - private const string ApprovedValue = "Approved"; - private const string RejectedValue = "Rejected"; - private const string DisconnectedValue = "Disconnected"; - - /// Pending. - public static ContainerServicePrivateLinkServiceConnectionStatus Pending { get; } = new ContainerServicePrivateLinkServiceConnectionStatus(PendingValue); - /// Approved. - public static ContainerServicePrivateLinkServiceConnectionStatus Approved { get; } = new ContainerServicePrivateLinkServiceConnectionStatus(ApprovedValue); - /// Rejected. - public static ContainerServicePrivateLinkServiceConnectionStatus Rejected { get; } = new ContainerServicePrivateLinkServiceConnectionStatus(RejectedValue); - /// Disconnected. - public static ContainerServicePrivateLinkServiceConnectionStatus Disconnected { get; } = new ContainerServicePrivateLinkServiceConnectionStatus(DisconnectedValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServicePrivateLinkServiceConnectionStatus left, ContainerServicePrivateLinkServiceConnectionStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServicePrivateLinkServiceConnectionStatus left, ContainerServicePrivateLinkServiceConnectionStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServicePrivateLinkServiceConnectionStatus(string value) => new ContainerServicePrivateLinkServiceConnectionStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServicePrivateLinkServiceConnectionStatus other && Equals(other); - /// - public bool Equals(ContainerServicePrivateLinkServiceConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePublicNetworkAccess.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePublicNetworkAccess.cs deleted file mode 100644 index 560b45660c83..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePublicNetworkAccess.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Allow or deny public network access for AKS. - public readonly partial struct ContainerServicePublicNetworkAccess : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServicePublicNetworkAccess(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static ContainerServicePublicNetworkAccess Enabled { get; } = new ContainerServicePublicNetworkAccess(EnabledValue); - /// Disabled. - public static ContainerServicePublicNetworkAccess Disabled { get; } = new ContainerServicePublicNetworkAccess(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServicePublicNetworkAccess left, ContainerServicePublicNetworkAccess right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServicePublicNetworkAccess left, ContainerServicePublicNetworkAccess right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServicePublicNetworkAccess(string value) => new ContainerServicePublicNetworkAccess(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServicePublicNetworkAccess other && Equals(other); - /// - public bool Equals(ContainerServicePublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceStateCode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceStateCode.cs deleted file mode 100644 index 7b9d0c7651b0..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceStateCode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Tells whether the cluster is Running or Stopped. - public readonly partial struct ContainerServiceStateCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceStateCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RunningValue = "Running"; - private const string StoppedValue = "Stopped"; - - /// The cluster is running. - public static ContainerServiceStateCode Running { get; } = new ContainerServiceStateCode(RunningValue); - /// The cluster is stopped. - public static ContainerServiceStateCode Stopped { get; } = new ContainerServiceStateCode(StoppedValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceStateCode left, ContainerServiceStateCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceStateCode left, ContainerServiceStateCode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceStateCode(string value) => new ContainerServiceStateCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceStateCode other && Equals(other); - /// - public bool Equals(ContainerServiceStateCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.cs deleted file mode 100644 index 2774da2a83e0..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Time in a week. - public partial class ContainerServiceTimeInWeek - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ContainerServiceTimeInWeek() - { - HourSlots = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The day of the week. - /// Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceTimeInWeek(ContainerServiceWeekDay? day, IList hourSlots, IDictionary serializedAdditionalRawData) - { - Day = day; - HourSlots = hourSlots; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The day of the week. - public ContainerServiceWeekDay? Day { get; set; } - /// Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. - public IList HourSlots { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.cs deleted file mode 100644 index cd32045b049a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Trusted access role definition. - public partial class ContainerServiceTrustedAccessRole - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ContainerServiceTrustedAccessRole() - { - Rules = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Resource type of Azure resource. - /// Name of role, name is unique under a source resource type. - /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole). - /// Keeps track of any properties unknown to the library. - internal ContainerServiceTrustedAccessRole(string sourceResourceType, string name, IReadOnlyList rules, IDictionary serializedAdditionalRawData) - { - SourceResourceType = sourceResourceType; - Name = name; - Rules = rules; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Resource type of Azure resource. - public string SourceResourceType { get; } - /// Name of role, name is unique under a source resource type. - public string Name { get; } - /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole). - public IReadOnlyList Rules { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingProvisioningState.cs deleted file mode 100644 index 6f599c8c26da..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleBindingProvisioningState.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The current provisioning state of trusted access role binding. - public readonly partial struct ContainerServiceTrustedAccessRoleBindingProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceTrustedAccessRoleBindingProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CanceledValue = "Canceled"; - private const string DeletingValue = "Deleting"; - private const string FailedValue = "Failed"; - private const string SucceededValue = "Succeeded"; - private const string UpdatingValue = "Updating"; - - /// Canceled. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Canceled { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(CanceledValue); - /// Deleting. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Deleting { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(DeletingValue); - /// Failed. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Failed { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(FailedValue); - /// Succeeded. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Succeeded { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(SucceededValue); - /// Updating. - public static ContainerServiceTrustedAccessRoleBindingProvisioningState Updating { get; } = new ContainerServiceTrustedAccessRoleBindingProvisioningState(UpdatingValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceTrustedAccessRoleBindingProvisioningState left, ContainerServiceTrustedAccessRoleBindingProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceTrustedAccessRoleBindingProvisioningState left, ContainerServiceTrustedAccessRoleBindingProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceTrustedAccessRoleBindingProvisioningState(string value) => new ContainerServiceTrustedAccessRoleBindingProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceTrustedAccessRoleBindingProvisioningState other && Equals(other); - /// - public bool Equals(ContainerServiceTrustedAccessRoleBindingProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.Serialization.cs deleted file mode 100644 index ae8c71f8375c..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.Serialization.cs +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceTrustedAccessRoleRule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleRule)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Verbs)) - { - writer.WritePropertyName("verbs"u8); - writer.WriteStartArray(); - foreach (var item in Verbs) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(ApiGroups)) - { - writer.WritePropertyName("apiGroups"u8); - writer.WriteStartArray(); - foreach (var item in ApiGroups) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(Resources)) - { - writer.WritePropertyName("resources"u8); - writer.WriteStartArray(); - foreach (var item in Resources) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(ResourceNames)) - { - writer.WritePropertyName("resourceNames"u8); - writer.WriteStartArray(); - foreach (var item in ResourceNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(NonResourceUrls)) - { - writer.WritePropertyName("nonResourceURLs"u8); - writer.WriteStartArray(); - foreach (var item in NonResourceUrls) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceTrustedAccessRoleRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleRule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTrustedAccessRoleRule(document.RootElement, options); - } - - internal static ContainerServiceTrustedAccessRoleRule DeserializeContainerServiceTrustedAccessRoleRule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList verbs = default; - IReadOnlyList apiGroups = default; - IReadOnlyList resources = default; - IReadOnlyList resourceNames = default; - IReadOnlyList nonResourceUrls = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("verbs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - verbs = array; - continue; - } - if (property.NameEquals("apiGroups"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - apiGroups = array; - continue; - } - if (property.NameEquals("resources"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - resources = array; - continue; - } - if (property.NameEquals("resourceNames"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - resourceNames = array; - continue; - } - if (property.NameEquals("nonResourceURLs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nonResourceUrls = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceTrustedAccessRoleRule( - verbs ?? new ChangeTrackingList(), - apiGroups ?? new ChangeTrackingList(), - resources ?? new ChangeTrackingList(), - resourceNames ?? new ChangeTrackingList(), - nonResourceUrls ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleRule)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceTrustedAccessRoleRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTrustedAccessRoleRule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRoleRule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.cs deleted file mode 100644 index 3d758f74f056..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRoleRule.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Rule for trusted access role. - public partial class ContainerServiceTrustedAccessRoleRule - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ContainerServiceTrustedAccessRoleRule() - { - Verbs = new ChangeTrackingList(); - ApiGroups = new ChangeTrackingList(); - Resources = new ChangeTrackingList(); - ResourceNames = new ChangeTrackingList(); - NonResourceUrls = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of allowed verbs. - /// List of allowed apiGroups. - /// List of allowed resources. - /// List of allowed names. - /// List of allowed nonResourceURLs. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceTrustedAccessRoleRule(IReadOnlyList verbs, IReadOnlyList apiGroups, IReadOnlyList resources, IReadOnlyList resourceNames, IReadOnlyList nonResourceUrls, IDictionary serializedAdditionalRawData) - { - Verbs = verbs; - ApiGroups = apiGroups; - Resources = resources; - ResourceNames = resourceNames; - NonResourceUrls = nonResourceUrls; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of allowed verbs. - public IReadOnlyList Verbs { get; } - /// List of allowed apiGroups. - public IReadOnlyList ApiGroups { get; } - /// List of allowed resources. - public IReadOnlyList Resources { get; } - /// List of allowed names. - public IReadOnlyList ResourceNames { get; } - /// List of allowed nonResourceURLs. - public IReadOnlyList NonResourceUrls { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.Serialization.cs deleted file mode 100644 index a9e48ee52928..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ContainerServiceUserAssignedIdentity : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceUserAssignedIdentity)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - } - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId.Value); - } - if (Optional.IsDefined(ObjectId)) - { - writer.WritePropertyName("objectId"u8); - writer.WriteStringValue(ObjectId.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContainerServiceUserAssignedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContainerServiceUserAssignedIdentity)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceUserAssignedIdentity(document.RootElement, options); - } - - internal static ContainerServiceUserAssignedIdentity DeserializeContainerServiceUserAssignedIdentity(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier resourceId = default; - Guid? clientId = default; - Guid? objectId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("clientId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clientId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("objectId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - objectId = property.Value.GetGuid(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceUserAssignedIdentity(resourceId, clientId, objectId, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContainerServiceUserAssignedIdentity)} does not support writing '{options.Format}' format."); - } - } - - ContainerServiceUserAssignedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceUserAssignedIdentity(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContainerServiceUserAssignedIdentity)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.cs deleted file mode 100644 index 3763163910e7..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceUserAssignedIdentity.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Details about a user assigned identity. - public partial class ContainerServiceUserAssignedIdentity - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ContainerServiceUserAssignedIdentity() - { - } - - /// Initializes a new instance of . - /// The resource ID of the user assigned identity. - /// The client ID of the user assigned identity. - /// The object ID of the user assigned identity. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceUserAssignedIdentity(ResourceIdentifier resourceId, Guid? clientId, Guid? objectId, IDictionary serializedAdditionalRawData) - { - ResourceId = resourceId; - ClientId = clientId; - ObjectId = objectId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The resource ID of the user assigned identity. - public ResourceIdentifier ResourceId { get; set; } - /// The client ID of the user assigned identity. - public Guid? ClientId { get; set; } - /// The object ID of the user assigned identity. - public Guid? ObjectId { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceWeekDay.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceWeekDay.cs deleted file mode 100644 index 94fd11d38de1..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceWeekDay.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The weekday enum. - public readonly partial struct ContainerServiceWeekDay : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ContainerServiceWeekDay(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SundayValue = "Sunday"; - private const string MondayValue = "Monday"; - private const string TuesdayValue = "Tuesday"; - private const string WednesdayValue = "Wednesday"; - private const string ThursdayValue = "Thursday"; - private const string FridayValue = "Friday"; - private const string SaturdayValue = "Saturday"; - - /// Sunday. - public static ContainerServiceWeekDay Sunday { get; } = new ContainerServiceWeekDay(SundayValue); - /// Monday. - public static ContainerServiceWeekDay Monday { get; } = new ContainerServiceWeekDay(MondayValue); - /// Tuesday. - public static ContainerServiceWeekDay Tuesday { get; } = new ContainerServiceWeekDay(TuesdayValue); - /// Wednesday. - public static ContainerServiceWeekDay Wednesday { get; } = new ContainerServiceWeekDay(WednesdayValue); - /// Thursday. - public static ContainerServiceWeekDay Thursday { get; } = new ContainerServiceWeekDay(ThursdayValue); - /// Friday. - public static ContainerServiceWeekDay Friday { get; } = new ContainerServiceWeekDay(FridayValue); - /// Saturday. - public static ContainerServiceWeekDay Saturday { get; } = new ContainerServiceWeekDay(SaturdayValue); - /// Determines if two values are the same. - public static bool operator ==(ContainerServiceWeekDay left, ContainerServiceWeekDay right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ContainerServiceWeekDay left, ContainerServiceWeekDay right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ContainerServiceWeekDay(string value) => new ContainerServiceWeekDay(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContainerServiceWeekDay other && Equals(other); - /// - public bool Equals(ContainerServiceWeekDay other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.Serialization.cs similarity index 65% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.Serialization.cs index eb24eb703a82..e7b49e5ac50f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ManagedClusterCredential : IUtf8JsonSerializable, IJsonModel + public partial class FleetCredentialResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterCredential)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteEndObject(); } - ManagedClusterCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetCredentialResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterCredential)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterCredential(document.RootElement, options); + return DeserializeFleetCredentialResult(document.RootElement, options); } - internal static ManagedClusterCredential DeserializeManagedClusterCredential(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetCredentialResult DeserializeFleetCredentialResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -100,38 +100,38 @@ internal static ManagedClusterCredential DeserializeManagedClusterCredential(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterCredential(name, value, serializedAdditionalRawData); + return new FleetCredentialResult(name, value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ManagedClusterCredential)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support writing '{options.Format}' format."); } } - ManagedClusterCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetCredentialResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterCredential(document.RootElement, options); + return DeserializeFleetCredentialResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterCredential)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.cs similarity index 82% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.cs index cfebe40f3551..3a56e8207e4d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredential.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResult.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// The credential result response. - public partial class ManagedClusterCredential + /// One credential result item. + public partial class FleetCredentialResult { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class ManagedClusterCredential /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ManagedClusterCredential() + /// Initializes a new instance of . + internal FleetCredentialResult() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the credential. /// Base64-encoded Kubernetes configuration file. /// Keeps track of any properties unknown to the library. - internal ManagedClusterCredential(string name, byte[] value, IDictionary serializedAdditionalRawData) + internal FleetCredentialResult(string name, byte[] value, IDictionary serializedAdditionalRawData) { Name = name; Value = value; diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.Serialization.cs similarity index 62% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.Serialization.cs index cde8dca4cc98..b9f44fd5dc84 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.Serialization.cs @@ -13,26 +13,26 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class KubernetesPatchVersion : IUtf8JsonSerializable, IJsonModel + public partial class FleetCredentialResults : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesPatchVersion)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Upgrades)) + if (options.Format != "W" && Optional.IsCollectionDefined(Kubeconfigs)) { - writer.WritePropertyName("upgrades"u8); + writer.WritePropertyName("kubeconfigs"u8); writer.WriteStartArray(); - foreach (var item in Upgrades) + foreach (var item in Kubeconfigs) { - writer.WriteStringValue(item); + writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteEndObject(); } - KubernetesPatchVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetCredentialResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesPatchVersion)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubernetesPatchVersion(document.RootElement, options); + return DeserializeFleetCredentialResults(document.RootElement, options); } - internal static KubernetesPatchVersion DeserializeKubernetesPatchVersion(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetCredentialResults DeserializeFleetCredentialResults(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -74,23 +74,23 @@ internal static KubernetesPatchVersion DeserializeKubernetesPatchVersion(JsonEle { return null; } - IReadOnlyList upgrades = default; + IReadOnlyList kubeconfigs = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("upgrades"u8)) + if (property.NameEquals("kubeconfigs"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + array.Add(FleetCredentialResult.DeserializeFleetCredentialResult(item, options)); } - upgrades = array; + kubeconfigs = array; continue; } if (options.Format != "W") @@ -99,38 +99,38 @@ internal static KubernetesPatchVersion DeserializeKubernetesPatchVersion(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new KubernetesPatchVersion(upgrades ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new FleetCredentialResults(kubeconfigs ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(KubernetesPatchVersion)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support writing '{options.Format}' format."); } } - KubernetesPatchVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetCredentialResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKubernetesPatchVersion(document.RootElement, options); + return DeserializeFleetCredentialResults(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(KubernetesPatchVersion)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetCredentialResults)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.cs similarity index 69% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.cs index 69925f2b36f9..dbfc5b17fa2a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetCredentialResults.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// The list credential result response. - public partial class ManagedClusterCredentials + /// The Credential results response. + public partial class FleetCredentialResults { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,22 @@ public partial class ManagedClusterCredentials /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ManagedClusterCredentials() + /// Initializes a new instance of . + internal FleetCredentialResults() { - Kubeconfigs = new ChangeTrackingList(); + Kubeconfigs = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Base64-encoded Kubernetes configuration file. + /// Initializes a new instance of . + /// Array of base64-encoded Kubernetes configuration files. /// Keeps track of any properties unknown to the library. - internal ManagedClusterCredentials(IReadOnlyList kubeconfigs, IDictionary serializedAdditionalRawData) + internal FleetCredentialResults(IReadOnlyList kubeconfigs, IDictionary serializedAdditionalRawData) { Kubeconfigs = kubeconfigs; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Base64-encoded Kubernetes configuration file. - public IReadOnlyList Kubeconfigs { get; } + /// Array of base64-encoded Kubernetes configuration files. + public IReadOnlyList Kubeconfigs { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.Serialization.cs new file mode 100644 index 000000000000..c278405bb442 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class FleetHubProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(DnsPrefix)) + { + writer.WritePropertyName("dnsPrefix"u8); + writer.WriteStringValue(DnsPrefix); + } + if (Optional.IsDefined(ApiServerAccessProfile)) + { + writer.WritePropertyName("apiServerAccessProfile"u8); + writer.WriteObjectValue(ApiServerAccessProfile, options); + } + if (Optional.IsDefined(AgentProfile)) + { + writer.WritePropertyName("agentProfile"u8); + writer.WriteObjectValue(AgentProfile, options); + } + if (options.Format != "W" && Optional.IsDefined(Fqdn)) + { + writer.WritePropertyName("fqdn"u8); + writer.WriteStringValue(Fqdn); + } + if (options.Format != "W" && Optional.IsDefined(KubernetesVersion)) + { + writer.WritePropertyName("kubernetesVersion"u8); + writer.WriteStringValue(KubernetesVersion); + } + if (options.Format != "W" && Optional.IsDefined(PortalFqdn)) + { + writer.WritePropertyName("portalFqdn"u8); + writer.WriteStringValue(PortalFqdn); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FleetHubProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetHubProfile(document.RootElement, options); + } + + internal static FleetHubProfile DeserializeFleetHubProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string dnsPrefix = default; + ApiServerAccessProfile apiServerAccessProfile = default; + AgentProfile agentProfile = default; + string fqdn = default; + string kubernetesVersion = default; + string portalFqdn = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dnsPrefix"u8)) + { + dnsPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiServerAccessProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apiServerAccessProfile = ApiServerAccessProfile.DeserializeApiServerAccessProfile(property.Value, options); + continue; + } + if (property.NameEquals("agentProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentProfile = AgentProfile.DeserializeAgentProfile(property.Value, options); + continue; + } + if (property.NameEquals("fqdn"u8)) + { + fqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("kubernetesVersion"u8)) + { + kubernetesVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("portalFqdn"u8)) + { + portalFqdn = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetHubProfile( + dnsPrefix, + apiServerAccessProfile, + agentProfile, + fqdn, + kubernetesVersion, + portalFqdn, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support writing '{options.Format}' format."); + } + } + + FleetHubProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetHubProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.cs new file mode 100644 index 000000000000..a66e1016923a --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetHubProfile.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The FleetHubProfile configures the fleet hub. + public partial class FleetHubProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetHubProfile() + { + } + + /// Initializes a new instance of . + /// DNS prefix used to create the FQDN for the Fleet hub. + /// The access profile for the Fleet hub API server. + /// The agent profile for the Fleet hub. + /// The FQDN of the Fleet hub. + /// The Kubernetes version of the Fleet hub. + /// The Azure Portal FQDN of the Fleet hub. + /// Keeps track of any properties unknown to the library. + internal FleetHubProfile(string dnsPrefix, ApiServerAccessProfile apiServerAccessProfile, AgentProfile agentProfile, string fqdn, string kubernetesVersion, string portalFqdn, IDictionary serializedAdditionalRawData) + { + DnsPrefix = dnsPrefix; + ApiServerAccessProfile = apiServerAccessProfile; + AgentProfile = agentProfile; + Fqdn = fqdn; + KubernetesVersion = kubernetesVersion; + PortalFqdn = portalFqdn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// DNS prefix used to create the FQDN for the Fleet hub. + public string DnsPrefix { get; set; } + /// The access profile for the Fleet hub API server. + internal ApiServerAccessProfile ApiServerAccessProfile { get; set; } + /// Whether to create the Fleet hub as a private cluster or not. + public bool? EnablePrivateCluster + { + get => ApiServerAccessProfile is null ? default : ApiServerAccessProfile.EnablePrivateCluster; + set + { + if (ApiServerAccessProfile is null) + ApiServerAccessProfile = new ApiServerAccessProfile(); + ApiServerAccessProfile.EnablePrivateCluster = value; + } + } + + /// The agent profile for the Fleet hub. + public AgentProfile AgentProfile { get; set; } + /// The FQDN of the Fleet hub. + public string Fqdn { get; } + /// The Kubernetes version of the Fleet hub. + public string KubernetesVersion { get; } + /// The Azure Portal FQDN of the Fleet hub. + public string PortalFqdn { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.Serialization.cs index 90f2143d9889..7d33f1a28784 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.Serialization.cs @@ -13,33 +13,30 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class MeshUpgradeProfileList : IUtf8JsonSerializable, IJsonModel + internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshUpgradeProfileList)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -59,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteEndObject(); } - MeshUpgradeProfileList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshUpgradeProfileList)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshUpgradeProfileList(document.RootElement, options); + return DeserializeFleetListResult(document.RootElement, options); } - internal static MeshUpgradeProfileList DeserializeMeshUpgradeProfileList(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetListResult DeserializeFleetListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,29 +76,29 @@ internal static MeshUpgradeProfileList DeserializeMeshUpgradeProfileList(JsonEle { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(item, options)); + array.Add(FleetData.DeserializeFleetData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -110,38 +107,38 @@ internal static MeshUpgradeProfileList DeserializeMeshUpgradeProfileList(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new MeshUpgradeProfileList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new FleetListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MeshUpgradeProfileList)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{options.Format}' format."); } } - MeshUpgradeProfileList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshUpgradeProfileList(document.RootElement, options); + return DeserializeFleetListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MeshUpgradeProfileList)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.cs similarity index 60% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.cs index b24c747b783d..81c272762800 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileList.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetListResult.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ContainerService.Models { - /// Holds an array of MeshUpgradeProfiles. - internal partial class MeshUpgradeProfileList + /// The response of a Fleet list operation. + internal partial class FleetListResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,35 @@ internal partial class MeshUpgradeProfileList /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal MeshUpgradeProfileList() + /// Initializes a new instance of . + /// The Fleet items on this page. + /// is null. + internal FleetListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } - /// Initializes a new instance of . - /// Array of supported service mesh add-on upgrade profiles. - /// The URL to get the next set of mesh upgrade profile. + /// Initializes a new instance of . + /// The Fleet items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal MeshUpgradeProfileList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal FleetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Array of supported service mesh add-on upgrade profiles. - public IReadOnlyList Value { get; } - /// The URL to get the next set of mesh upgrade profile. - public string NextLink { get; } + /// Initializes a new instance of for deserialization. + internal FleetListResult() + { + } + + /// The Fleet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.Serialization.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.Serialization.cs index 1fa0a300a3f3..5f9d1cb2534e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.Serialization.cs @@ -13,28 +13,30 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceIPTag : IUtf8JsonSerializable, IJsonModel + internal partial class FleetMemberListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceIPTag)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(IPTagType)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("ipTagType"u8); - writer.WriteStringValue(IPTagType); + writer.WriteObjectValue(item, options); } - if (Optional.IsDefined(Tag)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - writer.WritePropertyName("tag"u8); - writer.WriteStringValue(Tag); + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - ContainerServiceIPTag IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetMemberListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceIPTag)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceIPTag(document.RootElement, options); + return DeserializeFleetMemberListResult(document.RootElement, options); } - internal static ContainerServiceIPTag DeserializeContainerServiceIPTag(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetMemberListResult DeserializeFleetMemberListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -74,20 +76,29 @@ internal static ContainerServiceIPTag DeserializeContainerServiceIPTag(JsonEleme { return null; } - string ipTagType = default; - string tag = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("ipTagType"u8)) + if (property.NameEquals("value"u8)) { - ipTagType = property.Value.GetString(); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetMemberData.DeserializeFleetMemberData(item, options)); + } + value = array; continue; } - if (property.NameEquals("tag"u8)) + if (property.NameEquals("nextLink"u8)) { - tag = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -96,38 +107,38 @@ internal static ContainerServiceIPTag DeserializeContainerServiceIPTag(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceIPTag(ipTagType, tag, serializedAdditionalRawData); + return new FleetMemberListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceIPTag)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support writing '{options.Format}' format."); } } - ContainerServiceIPTag IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetMemberListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceIPTag(document.RootElement, options); + return DeserializeFleetMemberListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceIPTag)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.cs index 56f7dd4c04c8..497cfce88604 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberListResult.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ContainerService.Models { - /// Contains information about SSH certificate public key data. - public partial class ContainerServiceSshPublicKey + /// The response of a FleetMember list operation. + internal partial class FleetMemberListResult { /// /// Keeps track of any properties unknown to the library. @@ -45,31 +46,35 @@ public partial class ContainerServiceSshPublicKey /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. - /// is null. - public ContainerServiceSshPublicKey(string keyData) + /// Initializes a new instance of . + /// The FleetMember items on this page. + /// is null. + internal FleetMemberListResult(IEnumerable value) { - Argument.AssertNotNull(keyData, nameof(keyData)); + Argument.AssertNotNull(value, nameof(value)); - KeyData = keyData; + Value = value.ToList(); } - /// Initializes a new instance of . - /// Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. + /// Initializes a new instance of . + /// The FleetMember items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ContainerServiceSshPublicKey(string keyData, IDictionary serializedAdditionalRawData) + internal FleetMemberListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - KeyData = keyData; + Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContainerServiceSshPublicKey() + /// Initializes a new instance of for deserialization. + internal FleetMemberListResult() { } - /// Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. - public string KeyData { get; set; } + /// The FleetMember items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.Serialization.cs index db070552341a..0184def2c46c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.Serialization.cs @@ -13,24 +13,27 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class ContainerServiceCreationData : IUtf8JsonSerializable, IJsonModel + public partial class FleetMemberPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceCreationData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(SourceResourceId)) + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Group)) { - writer.WritePropertyName("sourceResourceId"u8); - writer.WriteStringValue(SourceResourceId); + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group); } + writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -49,19 +52,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - ContainerServiceCreationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetMemberPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceCreationData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceCreationData(document.RootElement, options); + return DeserializeFleetMemberPatch(document.RootElement, options); } - internal static ContainerServiceCreationData DeserializeContainerServiceCreationData(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetMemberPatch DeserializeFleetMemberPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,18 +72,26 @@ internal static ContainerServiceCreationData DeserializeContainerServiceCreation { return null; } - ResourceIdentifier sourceResourceId = default; + string group = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sourceResourceId"u8)) + if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + property.ThrowNonNullablePropertyIsNull(); continue; } - sourceResourceId = new ResourceIdentifier(property.Value.GetString()); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("group"u8)) + { + group = property0.Value.GetString(); + continue; + } + } continue; } if (options.Format != "W") @@ -89,38 +100,38 @@ internal static ContainerServiceCreationData DeserializeContainerServiceCreation } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceCreationData(sourceResourceId, serializedAdditionalRawData); + return new FleetMemberPatch(group, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceCreationData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support writing '{options.Format}' format."); } } - ContainerServiceCreationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetMemberPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceCreationData(document.RootElement, options); + return DeserializeFleetMemberPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceCreationData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetMemberPatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.cs similarity index 71% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.cs index 61257e310374..61ec9cccb288 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ClusterUpgradeSettings.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberPatch.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Settings for upgrading a cluster. - internal partial class ClusterUpgradeSettings + /// The type used for update operations of the FleetMember. + public partial class FleetMemberPatch { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,21 @@ internal partial class ClusterUpgradeSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ClusterUpgradeSettings() + /// Initializes a new instance of . + public FleetMemberPatch() { } - /// Initializes a new instance of . - /// Settings for overrides. + /// Initializes a new instance of . + /// The group this member belongs to for multi-cluster update management. /// Keeps track of any properties unknown to the library. - internal ClusterUpgradeSettings(UpgradeOverrideSettings overrideSettings, IDictionary serializedAdditionalRawData) + internal FleetMemberPatch(string group, IDictionary serializedAdditionalRawData) { - OverrideSettings = overrideSettings; + Group = group; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Settings for overrides. - public UpgradeOverrideSettings OverrideSettings { get; set; } + /// The group this member belongs to for multi-cluster update management. + public string Group { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberProvisioningState.cs new file mode 100644 index 000000000000..add7046185b2 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetMemberProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The provisioning state of the last accepted operation. + public readonly partial struct FleetMemberProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetMemberProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string JoiningValue = "Joining"; + private const string LeavingValue = "Leaving"; + private const string UpdatingValue = "Updating"; + + /// Resource has been created. + public static FleetMemberProvisioningState Succeeded { get; } = new FleetMemberProvisioningState(SucceededValue); + /// Resource creation failed. + public static FleetMemberProvisioningState Failed { get; } = new FleetMemberProvisioningState(FailedValue); + /// Resource creation was canceled. + public static FleetMemberProvisioningState Canceled { get; } = new FleetMemberProvisioningState(CanceledValue); + /// The provisioning state of a member joining a fleet. + public static FleetMemberProvisioningState Joining { get; } = new FleetMemberProvisioningState(JoiningValue); + /// The provisioning state of a member leaving a fleet. + public static FleetMemberProvisioningState Leaving { get; } = new FleetMemberProvisioningState(LeavingValue); + /// The provisioning state of a member being updated. + public static FleetMemberProvisioningState Updating { get; } = new FleetMemberProvisioningState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(FleetMemberProvisioningState left, FleetMemberProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetMemberProvisioningState left, FleetMemberProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FleetMemberProvisioningState(string value) => new FleetMemberProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetMemberProvisioningState other && Equals(other); + /// + public bool Equals(FleetMemberProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.Serialization.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.Serialization.cs index d1025d216e29..61f8c315df1c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.Serialization.cs @@ -10,19 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceTagsObject : IUtf8JsonSerializable, IJsonModel + public partial class FleetPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTagsObject)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetPatch)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -37,6 +38,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteEndObject(); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -55,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - ContainerServiceTagsObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTagsObject)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetPatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTagsObject(document.RootElement, options); + return DeserializeFleetPatch(document.RootElement, options); } - internal static ContainerServiceTagsObject DeserializeContainerServiceTagsObject(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetPatch DeserializeFleetPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,6 +82,7 @@ internal static ContainerServiceTagsObject DeserializeContainerServiceTagsObject return null; } IDictionary tags = default; + ResourceManager.Models.ManagedServiceIdentity identity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,44 +101,53 @@ internal static ContainerServiceTagsObject DeserializeContainerServiceTagsObject tags = dictionary; continue; } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceTagsObject(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new FleetPatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceTagsObject)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetPatch)} does not support writing '{options.Format}' format."); } } - ContainerServiceTagsObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTagsObject(document.RootElement, options); + return DeserializeFleetPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTagsObject)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetPatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.cs similarity index 73% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.cs index 0457fcf07154..dbdd993ce4d0 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTagsObject.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetPatch.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ContainerService.Models { - /// Tags object for patch operations. - public partial class ContainerServiceTagsObject + /// Properties of a Fleet that can be patched. + public partial class FleetPatch { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +46,26 @@ public partial class ContainerServiceTagsObject /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ContainerServiceTagsObject() + /// Initializes a new instance of . + public FleetPatch() { Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Resource tags. + /// Managed identity. /// Keeps track of any properties unknown to the library. - internal ContainerServiceTagsObject(IDictionary tags, IDictionary serializedAdditionalRawData) + internal FleetPatch(IDictionary tags, ResourceManager.Models.ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) { Tags = tags; + Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Resource tags. public IDictionary Tags { get; } + /// Managed identity. + public ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetProvisioningState.cs new file mode 100644 index 000000000000..e3b8c5f84ce9 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The provisioning state of the last accepted operation. + public readonly partial struct FleetProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + + /// Resource has been created. + public static FleetProvisioningState Succeeded { get; } = new FleetProvisioningState(SucceededValue); + /// Resource creation failed. + public static FleetProvisioningState Failed { get; } = new FleetProvisioningState(FailedValue); + /// Resource creation was canceled. + public static FleetProvisioningState Canceled { get; } = new FleetProvisioningState(CanceledValue); + /// The provisioning state of a fleet being created. + public static FleetProvisioningState Creating { get; } = new FleetProvisioningState(CreatingValue); + /// The provisioning state of a fleet being updated. + public static FleetProvisioningState Updating { get; } = new FleetProvisioningState(UpdatingValue); + /// The provisioning state of a fleet being deleted. + public static FleetProvisioningState Deleting { get; } = new FleetProvisioningState(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(FleetProvisioningState left, FleetProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetProvisioningState left, FleetProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FleetProvisioningState(string value) => new FleetProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetProvisioningState other && Equals(other); + /// + public bool Equals(FleetProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs index b8e48a2492f7..8c162ad019e2 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.Serialization.cs @@ -13,28 +13,30 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class KubernetesVersionCapabilities : IUtf8JsonSerializable, IJsonModel + internal partial class FleetUpdateStrategyListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesVersionCapabilities)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(SupportPlan)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("supportPlan"u8); - writer.WriteStartArray(); - foreach (var item in SupportPlan) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndObject(); } - KubernetesVersionCapabilities IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FleetUpdateStrategyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesVersionCapabilities)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubernetesVersionCapabilities(document.RootElement, options); + return DeserializeFleetUpdateStrategyListResult(document.RootElement, options); } - internal static KubernetesVersionCapabilities DeserializeKubernetesVersionCapabilities(JsonElement element, ModelReaderWriterOptions options = null) + internal static FleetUpdateStrategyListResult DeserializeFleetUpdateStrategyListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -74,23 +76,29 @@ internal static KubernetesVersionCapabilities DeserializeKubernetesVersionCapabi { return null; } - IReadOnlyList supportPlan = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("supportPlan"u8)) + if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(item, options)); } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) { - array.Add(new KubernetesSupportPlan(item.GetString())); + continue; } - supportPlan = array; + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -99,38 +107,38 @@ internal static KubernetesVersionCapabilities DeserializeKubernetesVersionCapabi } } serializedAdditionalRawData = rawDataDictionary; - return new KubernetesVersionCapabilities(supportPlan ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new FleetUpdateStrategyListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(KubernetesVersionCapabilities)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support writing '{options.Format}' format."); } } - KubernetesVersionCapabilities IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FleetUpdateStrategyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKubernetesVersionCapabilities(document.RootElement, options); + return DeserializeFleetUpdateStrategyListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(KubernetesVersionCapabilities)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FleetUpdateStrategyListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.cs index 1f0f87e4b4e0..1568d00f717a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyListResult.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// SSH configuration for Linux-based VMs running on Azure. - public partial class ContainerServiceSshConfiguration + /// The response of a FleetUpdateStrategy list operation. + internal partial class FleetUpdateStrategyListResult { /// /// Keeps track of any properties unknown to the library. @@ -46,31 +46,35 @@ public partial class ContainerServiceSshConfiguration /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - /// is null. - public ContainerServiceSshConfiguration(IEnumerable publicKeys) + /// Initializes a new instance of . + /// The FleetUpdateStrategy items on this page. + /// is null. + internal FleetUpdateStrategyListResult(IEnumerable value) { - Argument.AssertNotNull(publicKeys, nameof(publicKeys)); + Argument.AssertNotNull(value, nameof(value)); - PublicKeys = publicKeys.ToList(); + Value = value.ToList(); } - /// Initializes a new instance of . - /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// Initializes a new instance of . + /// The FleetUpdateStrategy items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ContainerServiceSshConfiguration(IList publicKeys, IDictionary serializedAdditionalRawData) + internal FleetUpdateStrategyListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - PublicKeys = publicKeys; + Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContainerServiceSshConfiguration() + /// Initializes a new instance of for deserialization. + internal FleetUpdateStrategyListResult() { } - /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. - public IList PublicKeys { get; } + /// The FleetUpdateStrategy items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs new file mode 100644 index 000000000000..9cc0408b585a --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/FleetUpdateStrategyProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The provisioning state of the UpdateStrategy resource. + public readonly partial struct FleetUpdateStrategyProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetUpdateStrategyProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static FleetUpdateStrategyProvisioningState Succeeded { get; } = new FleetUpdateStrategyProvisioningState(SucceededValue); + /// Resource creation failed. + public static FleetUpdateStrategyProvisioningState Failed { get; } = new FleetUpdateStrategyProvisioningState(FailedValue); + /// Resource creation was canceled. + public static FleetUpdateStrategyProvisioningState Canceled { get; } = new FleetUpdateStrategyProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(FleetUpdateStrategyProvisioningState left, FleetUpdateStrategyProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetUpdateStrategyProvisioningState left, FleetUpdateStrategyProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FleetUpdateStrategyProvisioningState(string value) => new FleetUpdateStrategyProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetUpdateStrategyProvisioningState other && Equals(other); + /// + public bool Equals(FleetUpdateStrategyProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuInstanceProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuInstanceProfile.cs deleted file mode 100644 index 29ffffd69556..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/GpuInstanceProfile.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - public readonly partial struct GpuInstanceProfile : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GpuInstanceProfile(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string Mig1GValue = "MIG1g"; - private const string Mig2GValue = "MIG2g"; - private const string Mig3GValue = "MIG3g"; - private const string Mig4GValue = "MIG4g"; - private const string Mig7GValue = "MIG7g"; - - /// MIG1g. - public static GpuInstanceProfile Mig1G { get; } = new GpuInstanceProfile(Mig1GValue); - /// MIG2g. - public static GpuInstanceProfile Mig2G { get; } = new GpuInstanceProfile(Mig2GValue); - /// MIG3g. - public static GpuInstanceProfile Mig3G { get; } = new GpuInstanceProfile(Mig3GValue); - /// MIG4g. - public static GpuInstanceProfile Mig4G { get; } = new GpuInstanceProfile(Mig4GValue); - /// MIG7g. - public static GpuInstanceProfile Mig7G { get; } = new GpuInstanceProfile(Mig7GValue); - /// Determines if two values are the same. - public static bool operator ==(GpuInstanceProfile left, GpuInstanceProfile right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GpuInstanceProfile left, GpuInstanceProfile right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GpuInstanceProfile(string value) => new GpuInstanceProfile(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GpuInstanceProfile other && Equals(other); - /// - public bool Equals(GpuInstanceProfile other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IPFamily.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IPFamily.cs deleted file mode 100644 index 08cfff2b105f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IPFamily.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The IP version to use for cluster networking and IP assignment. - public readonly partial struct IPFamily : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IPFamily(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IPv4Value = "IPv4"; - private const string IPv6Value = "IPv6"; - - /// IPv4. - public static IPFamily IPv4 { get; } = new IPFamily(IPv4Value); - /// IPv6. - public static IPFamily IPv6 { get; } = new IPFamily(IPv6Value); - /// Determines if two values are the same. - public static bool operator ==(IPFamily left, IPFamily right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IPFamily left, IPFamily right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IPFamily(string value) => new IPFamily(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IPFamily other && Equals(other); - /// - public bool Equals(IPFamily other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.cs deleted file mode 100644 index ebe0325999fe..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. - internal partial class IstioCertificateAuthority - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public IstioCertificateAuthority() - { - } - - /// Initializes a new instance of . - /// Plugin certificates information for Service Mesh. - /// Keeps track of any properties unknown to the library. - internal IstioCertificateAuthority(IstioPluginCertificateAuthority plugin, IDictionary serializedAdditionalRawData) - { - Plugin = plugin; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Plugin certificates information for Service Mesh. - public IstioPluginCertificateAuthority Plugin { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.cs deleted file mode 100644 index 0685a76efadb..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Istio components configuration. - public partial class IstioComponents - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public IstioComponents() - { - IngressGateways = new ChangeTrackingList(); - EgressGateways = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Istio ingress gateways. - /// Istio egress gateways. - /// Keeps track of any properties unknown to the library. - internal IstioComponents(IList ingressGateways, IList egressGateways, IDictionary serializedAdditionalRawData) - { - IngressGateways = ingressGateways; - EgressGateways = egressGateways; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Istio ingress gateways. - public IList IngressGateways { get; } - /// Istio egress gateways. - public IList EgressGateways { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs deleted file mode 100644 index c564d5f51aa7..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Istio egress gateway configuration. - public partial class IstioEgressGateway - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Whether to enable the egress gateway. - public IstioEgressGateway(bool isEnabled) - { - IsEnabled = isEnabled; - NodeSelector = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Whether to enable the egress gateway. - /// NodeSelector for scheduling the egress gateway. - /// Keeps track of any properties unknown to the library. - internal IstioEgressGateway(bool isEnabled, IDictionary nodeSelector, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - NodeSelector = nodeSelector; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal IstioEgressGateway() - { - } - - /// Whether to enable the egress gateway. - public bool IsEnabled { get; set; } - /// NodeSelector for scheduling the egress gateway. - public IDictionary NodeSelector { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.cs deleted file mode 100644 index be541e254278..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Istio ingress gateway configuration. For now, we support up to one external ingress gateway named `aks-istio-ingressgateway-external` and one internal ingress gateway named `aks-istio-ingressgateway-internal`. - public partial class IstioIngressGateway - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Mode of an ingress gateway. - /// Whether to enable the ingress gateway. - public IstioIngressGateway(IstioIngressGatewayMode mode, bool isEnabled) - { - Mode = mode; - IsEnabled = isEnabled; - } - - /// Initializes a new instance of . - /// Mode of an ingress gateway. - /// Whether to enable the ingress gateway. - /// Keeps track of any properties unknown to the library. - internal IstioIngressGateway(IstioIngressGatewayMode mode, bool isEnabled, IDictionary serializedAdditionalRawData) - { - Mode = mode; - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal IstioIngressGateway() - { - } - - /// Mode of an ingress gateway. - public IstioIngressGatewayMode Mode { get; set; } - /// Whether to enable the ingress gateway. - public bool IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGatewayMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGatewayMode.cs deleted file mode 100644 index ac4bf99bf6fc..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGatewayMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Mode of an ingress gateway. - public readonly partial struct IstioIngressGatewayMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IstioIngressGatewayMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ExternalValue = "External"; - private const string InternalValue = "Internal"; - - /// The ingress gateway is assigned a public IP address and is publicly accessible. - public static IstioIngressGatewayMode External { get; } = new IstioIngressGatewayMode(ExternalValue); - /// The ingress gateway is assigned an internal IP address and cannot is accessed publicly. - public static IstioIngressGatewayMode Internal { get; } = new IstioIngressGatewayMode(InternalValue); - /// Determines if two values are the same. - public static bool operator ==(IstioIngressGatewayMode left, IstioIngressGatewayMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IstioIngressGatewayMode left, IstioIngressGatewayMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IstioIngressGatewayMode(string value) => new IstioIngressGatewayMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IstioIngressGatewayMode other && Equals(other); - /// - public bool Equals(IstioIngressGatewayMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.Serialization.cs deleted file mode 100644 index ded24627ffc8..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.Serialization.cs +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class IstioPluginCertificateAuthority : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(IstioPluginCertificateAuthority)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(KeyVaultId)) - { - writer.WritePropertyName("keyVaultId"u8); - writer.WriteStringValue(KeyVaultId); - } - if (Optional.IsDefined(CertObjectName)) - { - writer.WritePropertyName("certObjectName"u8); - writer.WriteStringValue(CertObjectName); - } - if (Optional.IsDefined(KeyObjectName)) - { - writer.WritePropertyName("keyObjectName"u8); - writer.WriteStringValue(KeyObjectName); - } - if (Optional.IsDefined(RootCertObjectName)) - { - writer.WritePropertyName("rootCertObjectName"u8); - writer.WriteStringValue(RootCertObjectName); - } - if (Optional.IsDefined(CertChainObjectName)) - { - writer.WritePropertyName("certChainObjectName"u8); - writer.WriteStringValue(CertChainObjectName); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - IstioPluginCertificateAuthority IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(IstioPluginCertificateAuthority)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioPluginCertificateAuthority(document.RootElement, options); - } - - internal static IstioPluginCertificateAuthority DeserializeIstioPluginCertificateAuthority(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier keyVaultId = default; - string certObjectName = default; - string keyObjectName = default; - string rootCertObjectName = default; - string certChainObjectName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keyVaultId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - keyVaultId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("certObjectName"u8)) - { - certObjectName = property.Value.GetString(); - continue; - } - if (property.NameEquals("keyObjectName"u8)) - { - keyObjectName = property.Value.GetString(); - continue; - } - if (property.NameEquals("rootCertObjectName"u8)) - { - rootCertObjectName = property.Value.GetString(); - continue; - } - if (property.NameEquals("certChainObjectName"u8)) - { - certChainObjectName = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new IstioPluginCertificateAuthority( - keyVaultId, - certObjectName, - keyObjectName, - rootCertObjectName, - certChainObjectName, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(IstioPluginCertificateAuthority)} does not support writing '{options.Format}' format."); - } - } - - IstioPluginCertificateAuthority IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIstioPluginCertificateAuthority(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(IstioPluginCertificateAuthority)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.cs deleted file mode 100644 index c73d47b11e41..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioPluginCertificateAuthority.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Plugin certificates information for Service Mesh. - public partial class IstioPluginCertificateAuthority - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public IstioPluginCertificateAuthority() - { - } - - /// Initializes a new instance of . - /// The resource ID of the Key Vault. - /// Intermediate certificate object name in Azure Key Vault. - /// Intermediate certificate private key object name in Azure Key Vault. - /// Root certificate object name in Azure Key Vault. - /// Certificate chain object name in Azure Key Vault. - /// Keeps track of any properties unknown to the library. - internal IstioPluginCertificateAuthority(ResourceIdentifier keyVaultId, string certObjectName, string keyObjectName, string rootCertObjectName, string certChainObjectName, IDictionary serializedAdditionalRawData) - { - KeyVaultId = keyVaultId; - CertObjectName = certObjectName; - KeyObjectName = keyObjectName; - RootCertObjectName = rootCertObjectName; - CertChainObjectName = certChainObjectName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The resource ID of the Key Vault. - public ResourceIdentifier KeyVaultId { get; set; } - /// Intermediate certificate object name in Azure Key Vault. - public string CertObjectName { get; set; } - /// Intermediate certificate private key object name in Azure Key Vault. - public string KeyObjectName { get; set; } - /// Root certificate object name in Azure Key Vault. - public string RootCertObjectName { get; set; } - /// Certificate chain object name in Azure Key Vault. - public string CertChainObjectName { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.cs deleted file mode 100644 index 06ecb2b58b9a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Istio service mesh configuration. - public partial class IstioServiceMesh - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public IstioServiceMesh() - { - Revisions = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Istio components configuration. - /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. - /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. - /// Keeps track of any properties unknown to the library. - internal IstioServiceMesh(IstioComponents components, IstioCertificateAuthority certificateAuthority, IList revisions, IDictionary serializedAdditionalRawData) - { - Components = components; - CertificateAuthority = certificateAuthority; - Revisions = revisions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Istio components configuration. - public IstioComponents Components { get; set; } - /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. - internal IstioCertificateAuthority CertificateAuthority { get; set; } - /// Plugin certificates information for Service Mesh. - public IstioPluginCertificateAuthority CertificateAuthorityPlugin - { - get => CertificateAuthority is null ? default : CertificateAuthority.Plugin; - set - { - if (CertificateAuthority is null) - CertificateAuthority = new IstioCertificateAuthority(); - CertificateAuthority.Plugin = value; - } - } - - /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. - public IList Revisions { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeConfigFormat.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeConfigFormat.cs deleted file mode 100644 index e39f31e4ce1f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeConfigFormat.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The KubeConfigFormat. - public readonly partial struct KubeConfigFormat : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public KubeConfigFormat(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureValue = "azure"; - private const string ExecValue = "exec"; - - /// Return azure auth-provider kubeconfig. This format is deprecated in v1.22 and will be fully removed in v1.26. See: https://aka.ms/k8s/changes-1-26. - public static KubeConfigFormat Azure { get; } = new KubeConfigFormat(AzureValue); - /// Return exec format kubeconfig. This format requires kubelogin binary in the path. - public static KubeConfigFormat Exec { get; } = new KubeConfigFormat(ExecValue); - /// Determines if two values are the same. - public static bool operator ==(KubeConfigFormat left, KubeConfigFormat right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(KubeConfigFormat left, KubeConfigFormat right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator KubeConfigFormat(string value) => new KubeConfigFormat(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is KubeConfigFormat other && Equals(other); - /// - public bool Equals(KubeConfigFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.Serialization.cs deleted file mode 100644 index d319636385ea..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.Serialization.cs +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class KubeletConfig : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KubeletConfig)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(CpuManagerPolicy)) - { - writer.WritePropertyName("cpuManagerPolicy"u8); - writer.WriteStringValue(CpuManagerPolicy); - } - if (Optional.IsDefined(IsCpuCfsQuotaEnabled)) - { - writer.WritePropertyName("cpuCfsQuota"u8); - writer.WriteBooleanValue(IsCpuCfsQuotaEnabled.Value); - } - if (Optional.IsDefined(CpuCfsQuotaPeriod)) - { - writer.WritePropertyName("cpuCfsQuotaPeriod"u8); - writer.WriteStringValue(CpuCfsQuotaPeriod); - } - if (Optional.IsDefined(ImageGcHighThreshold)) - { - writer.WritePropertyName("imageGcHighThreshold"u8); - writer.WriteNumberValue(ImageGcHighThreshold.Value); - } - if (Optional.IsDefined(ImageGcLowThreshold)) - { - writer.WritePropertyName("imageGcLowThreshold"u8); - writer.WriteNumberValue(ImageGcLowThreshold.Value); - } - if (Optional.IsDefined(TopologyManagerPolicy)) - { - writer.WritePropertyName("topologyManagerPolicy"u8); - writer.WriteStringValue(TopologyManagerPolicy); - } - if (Optional.IsCollectionDefined(AllowedUnsafeSysctls)) - { - writer.WritePropertyName("allowedUnsafeSysctls"u8); - writer.WriteStartArray(); - foreach (var item in AllowedUnsafeSysctls) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(FailStartWithSwapOn)) - { - writer.WritePropertyName("failSwapOn"u8); - writer.WriteBooleanValue(FailStartWithSwapOn.Value); - } - if (Optional.IsDefined(ContainerLogMaxSizeInMB)) - { - writer.WritePropertyName("containerLogMaxSizeMB"u8); - writer.WriteNumberValue(ContainerLogMaxSizeInMB.Value); - } - if (Optional.IsDefined(ContainerLogMaxFiles)) - { - writer.WritePropertyName("containerLogMaxFiles"u8); - writer.WriteNumberValue(ContainerLogMaxFiles.Value); - } - if (Optional.IsDefined(PodMaxPids)) - { - writer.WritePropertyName("podMaxPids"u8); - writer.WriteNumberValue(PodMaxPids.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KubeletConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KubeletConfig)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubeletConfig(document.RootElement, options); - } - - internal static KubeletConfig DeserializeKubeletConfig(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string cpuManagerPolicy = default; - bool? cpuCfsQuota = default; - string cpuCfsQuotaPeriod = default; - int? imageGcHighThreshold = default; - int? imageGcLowThreshold = default; - string topologyManagerPolicy = default; - IList allowedUnsafeSysctls = default; - bool? failSwapOn = default; - int? containerLogMaxSizeMB = default; - int? containerLogMaxFiles = default; - int? podMaxPids = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cpuManagerPolicy"u8)) - { - cpuManagerPolicy = property.Value.GetString(); - continue; - } - if (property.NameEquals("cpuCfsQuota"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - cpuCfsQuota = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cpuCfsQuotaPeriod"u8)) - { - cpuCfsQuotaPeriod = property.Value.GetString(); - continue; - } - if (property.NameEquals("imageGcHighThreshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - imageGcHighThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("imageGcLowThreshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - imageGcLowThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("topologyManagerPolicy"u8)) - { - topologyManagerPolicy = property.Value.GetString(); - continue; - } - if (property.NameEquals("allowedUnsafeSysctls"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedUnsafeSysctls = array; - continue; - } - if (property.NameEquals("failSwapOn"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - failSwapOn = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("containerLogMaxSizeMB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - containerLogMaxSizeMB = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("containerLogMaxFiles"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - containerLogMaxFiles = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("podMaxPids"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podMaxPids = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new KubeletConfig( - cpuManagerPolicy, - cpuCfsQuota, - cpuCfsQuotaPeriod, - imageGcHighThreshold, - imageGcLowThreshold, - topologyManagerPolicy, - allowedUnsafeSysctls ?? new ChangeTrackingList(), - failSwapOn, - containerLogMaxSizeMB, - containerLogMaxFiles, - podMaxPids, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(KubeletConfig)} does not support writing '{options.Format}' format."); - } - } - - KubeletConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKubeletConfig(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KubeletConfig)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.cs deleted file mode 100644 index 2d3d4ed5a1a3..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletConfig.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. - public partial class KubeletConfig - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public KubeletConfig() - { - AllowedUnsafeSysctls = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'. - /// The default is true. - /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - /// To disable image garbage collection, set to 100. The default is 85%. - /// This cannot be set higher than imageGcHighThreshold. The default is 80%. - /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). - /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. - /// The maximum size (e.g. 10Mi) of container log file before it is rotated. - /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. - /// The maximum number of processes per pod. - /// Keeps track of any properties unknown to the library. - internal KubeletConfig(string cpuManagerPolicy, bool? isCpuCfsQuotaEnabled, string cpuCfsQuotaPeriod, int? imageGcHighThreshold, int? imageGcLowThreshold, string topologyManagerPolicy, IList allowedUnsafeSysctls, bool? failStartWithSwapOn, int? containerLogMaxSizeInMB, int? containerLogMaxFiles, int? podMaxPids, IDictionary serializedAdditionalRawData) - { - CpuManagerPolicy = cpuManagerPolicy; - IsCpuCfsQuotaEnabled = isCpuCfsQuotaEnabled; - CpuCfsQuotaPeriod = cpuCfsQuotaPeriod; - ImageGcHighThreshold = imageGcHighThreshold; - ImageGcLowThreshold = imageGcLowThreshold; - TopologyManagerPolicy = topologyManagerPolicy; - AllowedUnsafeSysctls = allowedUnsafeSysctls; - FailStartWithSwapOn = failStartWithSwapOn; - ContainerLogMaxSizeInMB = containerLogMaxSizeInMB; - ContainerLogMaxFiles = containerLogMaxFiles; - PodMaxPids = podMaxPids; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'. - public string CpuManagerPolicy { get; set; } - /// The default is true. - public bool? IsCpuCfsQuotaEnabled { get; set; } - /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. - public string CpuCfsQuotaPeriod { get; set; } - /// To disable image garbage collection, set to 100. The default is 85%. - public int? ImageGcHighThreshold { get; set; } - /// This cannot be set higher than imageGcHighThreshold. The default is 80%. - public int? ImageGcLowThreshold { get; set; } - /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. - public string TopologyManagerPolicy { get; set; } - /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). - public IList AllowedUnsafeSysctls { get; } - /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. - public bool? FailStartWithSwapOn { get; set; } - /// The maximum size (e.g. 10Mi) of container log file before it is rotated. - public int? ContainerLogMaxSizeInMB { get; set; } - /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. - public int? ContainerLogMaxFiles { get; set; } - /// The maximum number of processes per pod. - public int? PodMaxPids { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletDiskType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletDiskType.cs deleted file mode 100644 index 2f36aad548d4..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubeletDiskType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - public readonly partial struct KubeletDiskType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public KubeletDiskType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OSValue = "OS"; - private const string TemporaryValue = "Temporary"; - - /// Kubelet will use the OS disk for its data. - public static KubeletDiskType OS { get; } = new KubeletDiskType(OSValue); - /// Kubelet will use the temporary disk for its data. - public static KubeletDiskType Temporary { get; } = new KubeletDiskType(TemporaryValue); - /// Determines if two values are the same. - public static bool operator ==(KubeletDiskType left, KubeletDiskType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(KubeletDiskType left, KubeletDiskType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator KubeletDiskType(string value) => new KubeletDiskType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is KubeletDiskType other && Equals(other); - /// - public bool Equals(KubeletDiskType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesSupportPlan.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesSupportPlan.cs deleted file mode 100644 index c830411f0fce..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesSupportPlan.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Different support tiers for AKS managed clusters. - public readonly partial struct KubernetesSupportPlan : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public KubernetesSupportPlan(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string KubernetesOfficialValue = "KubernetesOfficial"; - private const string AKSLongTermSupportValue = "AKSLongTermSupport"; - - /// Support for the version is the same as for the open source Kubernetes offering. Official Kubernetes open source community support versions for 1 year after release. - public static KubernetesSupportPlan KubernetesOfficial { get; } = new KubernetesSupportPlan(KubernetesOfficialValue); - /// Support for the version extended past the KubernetesOfficial support of 1 year. AKS continues to patch CVEs for another 1 year, for a total of 2 years of support. - public static KubernetesSupportPlan AKSLongTermSupport { get; } = new KubernetesSupportPlan(AKSLongTermSupportValue); - /// Determines if two values are the same. - public static bool operator ==(KubernetesSupportPlan left, KubernetesSupportPlan right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(KubernetesSupportPlan left, KubernetesSupportPlan right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator KubernetesSupportPlan(string value) => new KubernetesSupportPlan(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is KubernetesSupportPlan other && Equals(other); - /// - public bool Equals(KubernetesSupportPlan other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs deleted file mode 100644 index ae7ec6cf7732..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Kubernetes version profile for given major.minor release. - public partial class KubernetesVersion - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal KubernetesVersion() - { - PatchVersions = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// major.minor version of Kubernetes release. - /// Capabilities on this Kubernetes version. - /// Whether this version is in preview mode. - /// Patch versions of Kubernetes release. - /// Keeps track of any properties unknown to the library. - internal KubernetesVersion(string version, KubernetesVersionCapabilities capabilities, bool? isPreview, IReadOnlyDictionary patchVersions, IDictionary serializedAdditionalRawData) - { - Version = version; - Capabilities = capabilities; - IsPreview = isPreview; - PatchVersions = patchVersions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// major.minor version of Kubernetes release. - public string Version { get; } - /// Capabilities on this Kubernetes version. - internal KubernetesVersionCapabilities Capabilities { get; } - /// Gets the capabilities support plan. - public IReadOnlyList CapabilitiesSupportPlan - { - get => Capabilities?.SupportPlan; - } - - /// Whether this version is in preview mode. - public bool? IsPreview { get; } - /// Patch versions of Kubernetes release. - public IReadOnlyDictionary PatchVersions { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.cs deleted file mode 100644 index 651431f19d3a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionCapabilities.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Capabilities on this Kubernetes version. - internal partial class KubernetesVersionCapabilities - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal KubernetesVersionCapabilities() - { - SupportPlan = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal KubernetesVersionCapabilities(IReadOnlyList supportPlan, IDictionary serializedAdditionalRawData) - { - SupportPlan = supportPlan; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the support plan. - public IReadOnlyList SupportPlan { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.Serialization.cs deleted file mode 100644 index e000c0334805..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class KubernetesVersionListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KubernetesVersionListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Values)) - { - writer.WritePropertyName("values"u8); - writer.WriteStartArray(); - foreach (var item in Values) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KubernetesVersionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KubernetesVersionListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubernetesVersionListResult(document.RootElement, options); - } - - internal static KubernetesVersionListResult DeserializeKubernetesVersionListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList values = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("values"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(KubernetesVersion.DeserializeKubernetesVersion(item, options)); - } - values = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new KubernetesVersionListResult(values ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(KubernetesVersionListResult)} does not support writing '{options.Format}' format."); - } - } - - KubernetesVersionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKubernetesVersionListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KubernetesVersionListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.Serialization.cs deleted file mode 100644 index 7bf72e22ee99..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class LinuxOSConfig : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LinuxOSConfig)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Sysctls)) - { - writer.WritePropertyName("sysctls"u8); - writer.WriteObjectValue(Sysctls, options); - } - if (Optional.IsDefined(TransparentHugePageEnabled)) - { - writer.WritePropertyName("transparentHugePageEnabled"u8); - writer.WriteStringValue(TransparentHugePageEnabled); - } - if (Optional.IsDefined(TransparentHugePageDefrag)) - { - writer.WritePropertyName("transparentHugePageDefrag"u8); - writer.WriteStringValue(TransparentHugePageDefrag); - } - if (Optional.IsDefined(SwapFileSizeInMB)) - { - writer.WritePropertyName("swapFileSizeMB"u8); - writer.WriteNumberValue(SwapFileSizeInMB.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - LinuxOSConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LinuxOSConfig)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLinuxOSConfig(document.RootElement, options); - } - - internal static LinuxOSConfig DeserializeLinuxOSConfig(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - SysctlConfig sysctls = default; - string transparentHugePageEnabled = default; - string transparentHugePageDefrag = default; - int? swapFileSizeMB = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sysctls"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sysctls = SysctlConfig.DeserializeSysctlConfig(property.Value, options); - continue; - } - if (property.NameEquals("transparentHugePageEnabled"u8)) - { - transparentHugePageEnabled = property.Value.GetString(); - continue; - } - if (property.NameEquals("transparentHugePageDefrag"u8)) - { - transparentHugePageDefrag = property.Value.GetString(); - continue; - } - if (property.NameEquals("swapFileSizeMB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - swapFileSizeMB = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new LinuxOSConfig(sysctls, transparentHugePageEnabled, transparentHugePageDefrag, swapFileSizeMB, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(LinuxOSConfig)} does not support writing '{options.Format}' format."); - } - } - - LinuxOSConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLinuxOSConfig(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(LinuxOSConfig)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.cs deleted file mode 100644 index ef69a0437876..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/LinuxOSConfig.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. - public partial class LinuxOSConfig - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public LinuxOSConfig() - { - } - - /// Initializes a new instance of . - /// Sysctl settings for Linux agent nodes. - /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). - /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). - /// The size in MB of a swap file that will be created on each node. - /// Keeps track of any properties unknown to the library. - internal LinuxOSConfig(SysctlConfig sysctls, string transparentHugePageEnabled, string transparentHugePageDefrag, int? swapFileSizeInMB, IDictionary serializedAdditionalRawData) - { - Sysctls = sysctls; - TransparentHugePageEnabled = transparentHugePageEnabled; - TransparentHugePageDefrag = transparentHugePageDefrag; - SwapFileSizeInMB = swapFileSizeInMB; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Sysctl settings for Linux agent nodes. - public SysctlConfig Sysctls { get; set; } - /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). - public string TransparentHugePageEnabled { get; set; } - /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). - public string TransparentHugePageDefrag { get; set; } - /// The size in MB of a swap file that will be created on each node. - public int? SwapFileSizeInMB { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.Serialization.cs deleted file mode 100644 index fcd7a998ce22..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.Serialization.cs +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterAadProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAadProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsManagedAadEnabled)) - { - writer.WritePropertyName("managed"u8); - writer.WriteBooleanValue(IsManagedAadEnabled.Value); - } - if (Optional.IsDefined(IsAzureRbacEnabled)) - { - writer.WritePropertyName("enableAzureRBAC"u8); - writer.WriteBooleanValue(IsAzureRbacEnabled.Value); - } - if (Optional.IsCollectionDefined(AdminGroupObjectIds)) - { - writer.WritePropertyName("adminGroupObjectIDs"u8); - writer.WriteStartArray(); - foreach (var item in AdminGroupObjectIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ClientAppId)) - { - writer.WritePropertyName("clientAppID"u8); - writer.WriteStringValue(ClientAppId.Value); - } - if (Optional.IsDefined(ServerAppId)) - { - writer.WritePropertyName("serverAppID"u8); - writer.WriteStringValue(ServerAppId.Value); - } - if (Optional.IsDefined(ServerAppSecret)) - { - writer.WritePropertyName("serverAppSecret"u8); - writer.WriteStringValue(ServerAppSecret); - } - if (Optional.IsDefined(TenantId)) - { - writer.WritePropertyName("tenantID"u8); - writer.WriteStringValue(TenantId.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAadProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAadProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAadProfile(document.RootElement, options); - } - - internal static ManagedClusterAadProfile DeserializeManagedClusterAadProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? managed = default; - bool? enableAzureRBAC = default; - IList adminGroupObjectIds = default; - Guid? clientAppId = default; - Guid? serverAppId = default; - string serverAppSecret = default; - Guid? tenantId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("managed"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - managed = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableAzureRBAC"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableAzureRBAC = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("adminGroupObjectIDs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetGuid()); - } - adminGroupObjectIds = array; - continue; - } - if (property.NameEquals("clientAppID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clientAppId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("serverAppID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - serverAppId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("serverAppSecret"u8)) - { - serverAppSecret = property.Value.GetString(); - continue; - } - if (property.NameEquals("tenantID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tenantId = property.Value.GetGuid(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterAadProfile( - managed, - enableAzureRBAC, - adminGroupObjectIds ?? new ChangeTrackingList(), - clientAppId, - serverAppId, - serverAppSecret, - tenantId, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterAadProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterAadProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAadProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAadProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.cs deleted file mode 100644 index 84535f3885fe..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAadProfile.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). - public partial class ManagedClusterAadProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterAadProfile() - { - AdminGroupObjectIds = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Whether to enable managed AAD. - /// Whether to enable Azure RBAC for Kubernetes authorization. - /// The list of AAD group object IDs that will have admin role of the cluster. - /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. - /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. - /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. - /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAadProfile(bool? isManagedAadEnabled, bool? isAzureRbacEnabled, IList adminGroupObjectIds, Guid? clientAppId, Guid? serverAppId, string serverAppSecret, Guid? tenantId, IDictionary serializedAdditionalRawData) - { - IsManagedAadEnabled = isManagedAadEnabled; - IsAzureRbacEnabled = isAzureRbacEnabled; - AdminGroupObjectIds = adminGroupObjectIds; - ClientAppId = clientAppId; - ServerAppId = serverAppId; - ServerAppSecret = serverAppSecret; - TenantId = tenantId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable managed AAD. - public bool? IsManagedAadEnabled { get; set; } - /// Whether to enable Azure RBAC for Kubernetes authorization. - public bool? IsAzureRbacEnabled { get; set; } - /// The list of AAD group object IDs that will have admin role of the cluster. - public IList AdminGroupObjectIds { get; } - /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. - public Guid? ClientAppId { get; set; } - /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. - public Guid? ServerAppId { get; set; } - /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. - public string ServerAppSecret { get; set; } - /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. - public Guid? TenantId { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.Serialization.cs deleted file mode 100644 index 407884ad8307..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.Serialization.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterAddonProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAddonProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled); - if (Optional.IsCollectionDefined(Config)) - { - writer.WritePropertyName("config"u8); - writer.WriteStartObject(); - foreach (var item in Config) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (options.Format != "W" && Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - writer.WriteObjectValue(Identity, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAddonProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAddonProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAddonProfile(document.RootElement, options); - } - - internal static ManagedClusterAddonProfile DeserializeManagedClusterAddonProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool enabled = default; - IDictionary config = default; - ManagedClusterAddonProfileIdentity identity = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("config"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - config = dictionary; - continue; - } - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = ManagedClusterAddonProfileIdentity.DeserializeManagedClusterAddonProfileIdentity(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterAddonProfile(enabled, config ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterAddonProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterAddonProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAddonProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAddonProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.cs deleted file mode 100644 index fa5e7a2744e6..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfile.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// A Kubernetes add-on profile for a managed cluster. - public partial class ManagedClusterAddonProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Whether the add-on is enabled or not. - public ManagedClusterAddonProfile(bool isEnabled) - { - IsEnabled = isEnabled; - Config = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Whether the add-on is enabled or not. - /// Key-value pairs for configuring an add-on. - /// Information of user assigned identity used by this add-on. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAddonProfile(bool isEnabled, IDictionary config, ManagedClusterAddonProfileIdentity identity, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - Config = config; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterAddonProfile() - { - } - - /// Whether the add-on is enabled or not. - public bool IsEnabled { get; set; } - /// Key-value pairs for configuring an add-on. - public IDictionary Config { get; } - /// Information of user assigned identity used by this add-on. - public ManagedClusterAddonProfileIdentity Identity { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.Serialization.cs deleted file mode 100644 index fec2e5484d96..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterAddonProfileIdentity : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAddonProfileIdentity)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - } - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId.Value); - } - if (Optional.IsDefined(ObjectId)) - { - writer.WritePropertyName("objectId"u8); - writer.WriteStringValue(ObjectId.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAddonProfileIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAddonProfileIdentity)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAddonProfileIdentity(document.RootElement, options); - } - - internal static ManagedClusterAddonProfileIdentity DeserializeManagedClusterAddonProfileIdentity(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier resourceId = default; - Guid? clientId = default; - Guid? objectId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("clientId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clientId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("objectId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - objectId = property.Value.GetGuid(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterAddonProfileIdentity(resourceId, clientId, objectId, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterAddonProfileIdentity)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterAddonProfileIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAddonProfileIdentity(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAddonProfileIdentity)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.cs deleted file mode 100644 index 4ce9fa1c8e1d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAddonProfileIdentity.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Information of user assigned identity used by this add-on. - public partial class ManagedClusterAddonProfileIdentity : ContainerServiceUserAssignedIdentity - { - /// Initializes a new instance of . - public ManagedClusterAddonProfileIdentity() - { - } - - /// Initializes a new instance of . - /// The resource ID of the user assigned identity. - /// The client ID of the user assigned identity. - /// The object ID of the user assigned identity. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAddonProfileIdentity(ResourceIdentifier resourceId, Guid? clientId, Guid? objectId, IDictionary serializedAdditionalRawData) : base(resourceId, clientId, objectId, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs deleted file mode 100644 index 32ded4c52d1f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs +++ /dev/null @@ -1,831 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterAgentPoolProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(VmSize)) - { - writer.WritePropertyName("vmSize"u8); - writer.WriteStringValue(VmSize); - } - if (Optional.IsDefined(OSDiskSizeInGB)) - { - writer.WritePropertyName("osDiskSizeGB"u8); - writer.WriteNumberValue(OSDiskSizeInGB.Value); - } - if (Optional.IsDefined(OSDiskType)) - { - writer.WritePropertyName("osDiskType"u8); - writer.WriteStringValue(OSDiskType.Value.ToString()); - } - if (Optional.IsDefined(KubeletDiskType)) - { - writer.WritePropertyName("kubeletDiskType"u8); - writer.WriteStringValue(KubeletDiskType.Value.ToString()); - } - if (Optional.IsDefined(WorkloadRuntime)) - { - writer.WritePropertyName("workloadRuntime"u8); - writer.WriteStringValue(WorkloadRuntime.Value.ToString()); - } - if (Optional.IsDefined(VnetSubnetId)) - { - writer.WritePropertyName("vnetSubnetID"u8); - writer.WriteStringValue(VnetSubnetId); - } - if (Optional.IsDefined(PodSubnetId)) - { - writer.WritePropertyName("podSubnetID"u8); - writer.WriteStringValue(PodSubnetId); - } - if (Optional.IsDefined(MaxPods)) - { - writer.WritePropertyName("maxPods"u8); - writer.WriteNumberValue(MaxPods.Value); - } - if (Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.Value.ToString()); - } - if (Optional.IsDefined(OSSku)) - { - writer.WritePropertyName("osSKU"u8); - writer.WriteStringValue(OSSku.Value.ToString()); - } - if (Optional.IsDefined(MaxCount)) - { - writer.WritePropertyName("maxCount"u8); - writer.WriteNumberValue(MaxCount.Value); - } - if (Optional.IsDefined(MinCount)) - { - writer.WritePropertyName("minCount"u8); - writer.WriteNumberValue(MinCount.Value); - } - if (Optional.IsDefined(EnableAutoScaling)) - { - writer.WritePropertyName("enableAutoScaling"u8); - writer.WriteBooleanValue(EnableAutoScaling.Value); - } - if (Optional.IsDefined(ScaleDownMode)) - { - writer.WritePropertyName("scaleDownMode"u8); - writer.WriteStringValue(ScaleDownMode.Value.ToString()); - } - if (Optional.IsDefined(AgentPoolType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(AgentPoolType.Value.ToString()); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(OrchestratorVersion)) - { - writer.WritePropertyName("orchestratorVersion"u8); - writer.WriteStringValue(OrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(CurrentOrchestratorVersion)) - { - writer.WritePropertyName("currentOrchestratorVersion"u8); - writer.WriteStringValue(CurrentOrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(NodeImageVersion)) - { - writer.WritePropertyName("nodeImageVersion"u8); - writer.WriteStringValue(NodeImageVersion); - } - if (Optional.IsDefined(UpgradeSettings)) - { - writer.WritePropertyName("upgradeSettings"u8); - writer.WriteObjectValue(UpgradeSettings, options); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (Optional.IsDefined(PowerState)) - { - writer.WritePropertyName("powerState"u8); - writer.WriteObjectValue(PowerState, options); - } - if (Optional.IsCollectionDefined(AvailabilityZones)) - { - writer.WritePropertyName("availabilityZones"u8); - writer.WriteStartArray(); - foreach (var item in AvailabilityZones) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(EnableNodePublicIP)) - { - writer.WritePropertyName("enableNodePublicIP"u8); - writer.WriteBooleanValue(EnableNodePublicIP.Value); - } - if (Optional.IsDefined(NodePublicIPPrefixId)) - { - writer.WritePropertyName("nodePublicIPPrefixID"u8); - writer.WriteStringValue(NodePublicIPPrefixId); - } - if (Optional.IsDefined(ScaleSetPriority)) - { - writer.WritePropertyName("scaleSetPriority"u8); - writer.WriteStringValue(ScaleSetPriority.Value.ToString()); - } - if (Optional.IsDefined(ScaleSetEvictionPolicy)) - { - writer.WritePropertyName("scaleSetEvictionPolicy"u8); - writer.WriteStringValue(ScaleSetEvictionPolicy.Value.ToString()); - } - if (Optional.IsDefined(SpotMaxPrice)) - { - writer.WritePropertyName("spotMaxPrice"u8); - writer.WriteNumberValue(SpotMaxPrice.Value); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(NodeLabels)) - { - writer.WritePropertyName("nodeLabels"u8); - writer.WriteStartObject(); - foreach (var item in NodeLabels) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(NodeTaints)) - { - writer.WritePropertyName("nodeTaints"u8); - writer.WriteStartArray(); - foreach (var item in NodeTaints) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ProximityPlacementGroupId)) - { - writer.WritePropertyName("proximityPlacementGroupID"u8); - writer.WriteStringValue(ProximityPlacementGroupId); - } - if (Optional.IsDefined(KubeletConfig)) - { - writer.WritePropertyName("kubeletConfig"u8); - writer.WriteObjectValue(KubeletConfig, options); - } - if (Optional.IsDefined(LinuxOSConfig)) - { - writer.WritePropertyName("linuxOSConfig"u8); - writer.WriteObjectValue(LinuxOSConfig, options); - } - if (Optional.IsDefined(EnableEncryptionAtHost)) - { - writer.WritePropertyName("enableEncryptionAtHost"u8); - writer.WriteBooleanValue(EnableEncryptionAtHost.Value); - } - if (Optional.IsDefined(EnableUltraSsd)) - { - writer.WritePropertyName("enableUltraSSD"u8); - writer.WriteBooleanValue(EnableUltraSsd.Value); - } - if (Optional.IsDefined(EnableFips)) - { - writer.WritePropertyName("enableFIPS"u8); - writer.WriteBooleanValue(EnableFips.Value); - } - if (Optional.IsDefined(GpuInstanceProfile)) - { - writer.WritePropertyName("gpuInstanceProfile"u8); - writer.WriteStringValue(GpuInstanceProfile.Value.ToString()); - } - if (Optional.IsDefined(CreationData)) - { - writer.WritePropertyName("creationData"u8); - writer.WriteObjectValue(CreationData, options); - } - if (Optional.IsDefined(CapacityReservationGroupId)) - { - writer.WritePropertyName("capacityReservationGroupID"u8); - writer.WriteStringValue(CapacityReservationGroupId); - } - if (Optional.IsDefined(HostGroupId)) - { - writer.WritePropertyName("hostGroupID"u8); - writer.WriteStringValue(HostGroupId); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAgentPoolProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAgentPoolProfile(document.RootElement, options); - } - - internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoolProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - int? count = default; - string vmSize = default; - int? osDiskSizeGB = default; - ContainerServiceOSDiskType? osDiskType = default; - KubeletDiskType? kubeletDiskType = default; - WorkloadRuntime? workloadRuntime = default; - ResourceIdentifier vnetSubnetId = default; - ResourceIdentifier podSubnetId = default; - int? maxPods = default; - ContainerServiceOSType? osType = default; - ContainerServiceOSSku? osSku = default; - int? maxCount = default; - int? minCount = default; - bool? enableAutoScaling = default; - ScaleDownMode? scaleDownMode = default; - AgentPoolType? type = default; - AgentPoolMode? mode = default; - string orchestratorVersion = default; - string currentOrchestratorVersion = default; - string nodeImageVersion = default; - AgentPoolUpgradeSettings upgradeSettings = default; - string provisioningState = default; - ContainerServicePowerState powerState = default; - IList availabilityZones = default; - bool? enableNodePublicIP = default; - ResourceIdentifier nodePublicIPPrefixId = default; - ScaleSetPriority? scaleSetPriority = default; - ScaleSetEvictionPolicy? scaleSetEvictionPolicy = default; - float? spotMaxPrice = default; - IDictionary tags = default; - IDictionary nodeLabels = default; - IList nodeTaints = default; - ResourceIdentifier proximityPlacementGroupId = default; - KubeletConfig kubeletConfig = default; - LinuxOSConfig linuxOSConfig = default; - bool? enableEncryptionAtHost = default; - bool? enableUltraSsd = default; - bool? enableFIPS = default; - GpuInstanceProfile? gpuInstanceProfile = default; - ContainerServiceCreationData creationData = default; - ResourceIdentifier capacityReservationGroupId = default; - ResourceIdentifier hostGroupId = default; - AgentPoolNetworkProfile networkProfile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("count"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmSize"u8)) - { - vmSize = property.Value.GetString(); - continue; - } - if (property.NameEquals("osDiskSizeGB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskSizeGB = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("osDiskType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskType = new ContainerServiceOSDiskType(property.Value.GetString()); - continue; - } - if (property.NameEquals("kubeletDiskType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletDiskType = new KubeletDiskType(property.Value.GetString()); - continue; - } - if (property.NameEquals("workloadRuntime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadRuntime = new WorkloadRuntime(property.Value.GetString()); - continue; - } - if (property.NameEquals("vnetSubnetID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vnetSubnetId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("podSubnetID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podSubnetId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("maxPods"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxPods = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("osType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osType = new ContainerServiceOSType(property.Value.GetString()); - continue; - } - if (property.NameEquals("osSKU"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osSku = new ContainerServiceOSSku(property.Value.GetString()); - continue; - } - if (property.NameEquals("maxCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("minCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - minCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enableAutoScaling"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableAutoScaling = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("scaleDownMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleDownMode = new ScaleDownMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new AgentPoolType(property.Value.GetString()); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new AgentPoolMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("orchestratorVersion"u8)) - { - orchestratorVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("currentOrchestratorVersion"u8)) - { - currentOrchestratorVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("nodeImageVersion"u8)) - { - nodeImageVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("upgradeSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeSettings = AgentPoolUpgradeSettings.DeserializeAgentPoolUpgradeSettings(property.Value, options); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - provisioningState = property.Value.GetString(); - continue; - } - if (property.NameEquals("powerState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - powerState = ContainerServicePowerState.DeserializeContainerServicePowerState(property.Value, options); - continue; - } - if (property.NameEquals("availabilityZones"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - availabilityZones = array; - continue; - } - if (property.NameEquals("enableNodePublicIP"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableNodePublicIP = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("nodePublicIPPrefixID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nodePublicIPPrefixId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("scaleSetPriority"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetPriority = new ScaleSetPriority(property.Value.GetString()); - continue; - } - if (property.NameEquals("scaleSetEvictionPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetEvictionPolicy = new ScaleSetEvictionPolicy(property.Value.GetString()); - continue; - } - if (property.NameEquals("spotMaxPrice"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - spotMaxPrice = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("nodeLabels"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - nodeLabels = dictionary; - continue; - } - if (property.NameEquals("nodeTaints"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nodeTaints = array; - continue; - } - if (property.NameEquals("proximityPlacementGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - proximityPlacementGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("kubeletConfig"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletConfig = KubeletConfig.DeserializeKubeletConfig(property.Value, options); - continue; - } - if (property.NameEquals("linuxOSConfig"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - linuxOSConfig = LinuxOSConfig.DeserializeLinuxOSConfig(property.Value, options); - continue; - } - if (property.NameEquals("enableEncryptionAtHost"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableEncryptionAtHost = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableUltraSSD"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableUltraSsd = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableFIPS"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFIPS = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("gpuInstanceProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gpuInstanceProfile = new GpuInstanceProfile(property.Value.GetString()); - continue; - } - if (property.NameEquals("creationData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - creationData = ContainerServiceCreationData.DeserializeContainerServiceCreationData(property.Value, options); - continue; - } - if (property.NameEquals("capacityReservationGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityReservationGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("hostGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - hostGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterAgentPoolProfile( - count, - vmSize, - osDiskSizeGB, - osDiskType, - kubeletDiskType, - workloadRuntime, - vnetSubnetId, - podSubnetId, - maxPods, - osType, - osSku, - maxCount, - minCount, - enableAutoScaling, - scaleDownMode, - type, - mode, - orchestratorVersion, - currentOrchestratorVersion, - nodeImageVersion, - upgradeSettings, - provisioningState, - powerState, - availabilityZones ?? new ChangeTrackingList(), - enableNodePublicIP, - nodePublicIPPrefixId, - scaleSetPriority, - scaleSetEvictionPolicy, - spotMaxPrice, - tags ?? new ChangeTrackingDictionary(), - nodeLabels ?? new ChangeTrackingDictionary(), - nodeTaints ?? new ChangeTrackingList(), - proximityPlacementGroupId, - kubeletConfig, - linuxOSConfig, - enableEncryptionAtHost, - enableUltraSsd, - enableFIPS, - gpuInstanceProfile, - creationData, - capacityReservationGroupId, - hostGroupId, - networkProfile, - serializedAdditionalRawData, - name); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterAgentPoolProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAgentPoolProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs deleted file mode 100644 index b110730162b5..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Profile for the container service agent pool. - public partial class ManagedClusterAgentPoolProfile : ManagedClusterAgentPoolProfileProperties - { - /// Initializes a new instance of . - /// Windows agent pool names must be 6 characters or less. - /// is null. - public ManagedClusterAgentPoolProfile(string name) - { - Argument.AssertNotNull(name, nameof(name)); - - Name = name; - } - - /// Initializes a new instance of . - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// Keeps track of any properties unknown to the library. - /// Windows agent pool names must be 6 characters or less. - internal ManagedClusterAgentPoolProfile(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData, string name) : base(count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationData, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData) - { - Name = name; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterAgentPoolProfile() - { - } - - /// Windows agent pool names must be 6 characters or less. - public string Name { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs deleted file mode 100644 index c9134313a8c3..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs +++ /dev/null @@ -1,822 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterAgentPoolProfileProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfileProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(VmSize)) - { - writer.WritePropertyName("vmSize"u8); - writer.WriteStringValue(VmSize); - } - if (Optional.IsDefined(OSDiskSizeInGB)) - { - writer.WritePropertyName("osDiskSizeGB"u8); - writer.WriteNumberValue(OSDiskSizeInGB.Value); - } - if (Optional.IsDefined(OSDiskType)) - { - writer.WritePropertyName("osDiskType"u8); - writer.WriteStringValue(OSDiskType.Value.ToString()); - } - if (Optional.IsDefined(KubeletDiskType)) - { - writer.WritePropertyName("kubeletDiskType"u8); - writer.WriteStringValue(KubeletDiskType.Value.ToString()); - } - if (Optional.IsDefined(WorkloadRuntime)) - { - writer.WritePropertyName("workloadRuntime"u8); - writer.WriteStringValue(WorkloadRuntime.Value.ToString()); - } - if (Optional.IsDefined(VnetSubnetId)) - { - writer.WritePropertyName("vnetSubnetID"u8); - writer.WriteStringValue(VnetSubnetId); - } - if (Optional.IsDefined(PodSubnetId)) - { - writer.WritePropertyName("podSubnetID"u8); - writer.WriteStringValue(PodSubnetId); - } - if (Optional.IsDefined(MaxPods)) - { - writer.WritePropertyName("maxPods"u8); - writer.WriteNumberValue(MaxPods.Value); - } - if (Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.Value.ToString()); - } - if (Optional.IsDefined(OSSku)) - { - writer.WritePropertyName("osSKU"u8); - writer.WriteStringValue(OSSku.Value.ToString()); - } - if (Optional.IsDefined(MaxCount)) - { - writer.WritePropertyName("maxCount"u8); - writer.WriteNumberValue(MaxCount.Value); - } - if (Optional.IsDefined(MinCount)) - { - writer.WritePropertyName("minCount"u8); - writer.WriteNumberValue(MinCount.Value); - } - if (Optional.IsDefined(EnableAutoScaling)) - { - writer.WritePropertyName("enableAutoScaling"u8); - writer.WriteBooleanValue(EnableAutoScaling.Value); - } - if (Optional.IsDefined(ScaleDownMode)) - { - writer.WritePropertyName("scaleDownMode"u8); - writer.WriteStringValue(ScaleDownMode.Value.ToString()); - } - if (Optional.IsDefined(AgentPoolType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(AgentPoolType.Value.ToString()); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(OrchestratorVersion)) - { - writer.WritePropertyName("orchestratorVersion"u8); - writer.WriteStringValue(OrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(CurrentOrchestratorVersion)) - { - writer.WritePropertyName("currentOrchestratorVersion"u8); - writer.WriteStringValue(CurrentOrchestratorVersion); - } - if (options.Format != "W" && Optional.IsDefined(NodeImageVersion)) - { - writer.WritePropertyName("nodeImageVersion"u8); - writer.WriteStringValue(NodeImageVersion); - } - if (Optional.IsDefined(UpgradeSettings)) - { - writer.WritePropertyName("upgradeSettings"u8); - writer.WriteObjectValue(UpgradeSettings, options); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (Optional.IsDefined(PowerState)) - { - writer.WritePropertyName("powerState"u8); - writer.WriteObjectValue(PowerState, options); - } - if (Optional.IsCollectionDefined(AvailabilityZones)) - { - writer.WritePropertyName("availabilityZones"u8); - writer.WriteStartArray(); - foreach (var item in AvailabilityZones) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(EnableNodePublicIP)) - { - writer.WritePropertyName("enableNodePublicIP"u8); - writer.WriteBooleanValue(EnableNodePublicIP.Value); - } - if (Optional.IsDefined(NodePublicIPPrefixId)) - { - writer.WritePropertyName("nodePublicIPPrefixID"u8); - writer.WriteStringValue(NodePublicIPPrefixId); - } - if (Optional.IsDefined(ScaleSetPriority)) - { - writer.WritePropertyName("scaleSetPriority"u8); - writer.WriteStringValue(ScaleSetPriority.Value.ToString()); - } - if (Optional.IsDefined(ScaleSetEvictionPolicy)) - { - writer.WritePropertyName("scaleSetEvictionPolicy"u8); - writer.WriteStringValue(ScaleSetEvictionPolicy.Value.ToString()); - } - if (Optional.IsDefined(SpotMaxPrice)) - { - writer.WritePropertyName("spotMaxPrice"u8); - writer.WriteNumberValue(SpotMaxPrice.Value); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(NodeLabels)) - { - writer.WritePropertyName("nodeLabels"u8); - writer.WriteStartObject(); - foreach (var item in NodeLabels) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(NodeTaints)) - { - writer.WritePropertyName("nodeTaints"u8); - writer.WriteStartArray(); - foreach (var item in NodeTaints) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ProximityPlacementGroupId)) - { - writer.WritePropertyName("proximityPlacementGroupID"u8); - writer.WriteStringValue(ProximityPlacementGroupId); - } - if (Optional.IsDefined(KubeletConfig)) - { - writer.WritePropertyName("kubeletConfig"u8); - writer.WriteObjectValue(KubeletConfig, options); - } - if (Optional.IsDefined(LinuxOSConfig)) - { - writer.WritePropertyName("linuxOSConfig"u8); - writer.WriteObjectValue(LinuxOSConfig, options); - } - if (Optional.IsDefined(EnableEncryptionAtHost)) - { - writer.WritePropertyName("enableEncryptionAtHost"u8); - writer.WriteBooleanValue(EnableEncryptionAtHost.Value); - } - if (Optional.IsDefined(EnableUltraSsd)) - { - writer.WritePropertyName("enableUltraSSD"u8); - writer.WriteBooleanValue(EnableUltraSsd.Value); - } - if (Optional.IsDefined(EnableFips)) - { - writer.WritePropertyName("enableFIPS"u8); - writer.WriteBooleanValue(EnableFips.Value); - } - if (Optional.IsDefined(GpuInstanceProfile)) - { - writer.WritePropertyName("gpuInstanceProfile"u8); - writer.WriteStringValue(GpuInstanceProfile.Value.ToString()); - } - if (Optional.IsDefined(CreationData)) - { - writer.WritePropertyName("creationData"u8); - writer.WriteObjectValue(CreationData, options); - } - if (Optional.IsDefined(CapacityReservationGroupId)) - { - writer.WritePropertyName("capacityReservationGroupID"u8); - writer.WriteStringValue(CapacityReservationGroupId); - } - if (Optional.IsDefined(HostGroupId)) - { - writer.WritePropertyName("hostGroupID"u8); - writer.WriteStringValue(HostGroupId); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAgentPoolProfileProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfileProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAgentPoolProfileProperties(document.RootElement, options); - } - - internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClusterAgentPoolProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? count = default; - string vmSize = default; - int? osDiskSizeGB = default; - ContainerServiceOSDiskType? osDiskType = default; - KubeletDiskType? kubeletDiskType = default; - WorkloadRuntime? workloadRuntime = default; - ResourceIdentifier vnetSubnetId = default; - ResourceIdentifier podSubnetId = default; - int? maxPods = default; - ContainerServiceOSType? osType = default; - ContainerServiceOSSku? osSku = default; - int? maxCount = default; - int? minCount = default; - bool? enableAutoScaling = default; - ScaleDownMode? scaleDownMode = default; - AgentPoolType? type = default; - AgentPoolMode? mode = default; - string orchestratorVersion = default; - string currentOrchestratorVersion = default; - string nodeImageVersion = default; - AgentPoolUpgradeSettings upgradeSettings = default; - string provisioningState = default; - ContainerServicePowerState powerState = default; - IList availabilityZones = default; - bool? enableNodePublicIP = default; - ResourceIdentifier nodePublicIPPrefixId = default; - ScaleSetPriority? scaleSetPriority = default; - ScaleSetEvictionPolicy? scaleSetEvictionPolicy = default; - float? spotMaxPrice = default; - IDictionary tags = default; - IDictionary nodeLabels = default; - IList nodeTaints = default; - ResourceIdentifier proximityPlacementGroupId = default; - KubeletConfig kubeletConfig = default; - LinuxOSConfig linuxOSConfig = default; - bool? enableEncryptionAtHost = default; - bool? enableUltraSsd = default; - bool? enableFIPS = default; - GpuInstanceProfile? gpuInstanceProfile = default; - ContainerServiceCreationData creationData = default; - ResourceIdentifier capacityReservationGroupId = default; - ResourceIdentifier hostGroupId = default; - AgentPoolNetworkProfile networkProfile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("count"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmSize"u8)) - { - vmSize = property.Value.GetString(); - continue; - } - if (property.NameEquals("osDiskSizeGB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskSizeGB = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("osDiskType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osDiskType = new ContainerServiceOSDiskType(property.Value.GetString()); - continue; - } - if (property.NameEquals("kubeletDiskType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletDiskType = new KubeletDiskType(property.Value.GetString()); - continue; - } - if (property.NameEquals("workloadRuntime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadRuntime = new WorkloadRuntime(property.Value.GetString()); - continue; - } - if (property.NameEquals("vnetSubnetID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vnetSubnetId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("podSubnetID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - podSubnetId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("maxPods"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxPods = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("osType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osType = new ContainerServiceOSType(property.Value.GetString()); - continue; - } - if (property.NameEquals("osSKU"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osSku = new ContainerServiceOSSku(property.Value.GetString()); - continue; - } - if (property.NameEquals("maxCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("minCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - minCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enableAutoScaling"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableAutoScaling = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("scaleDownMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleDownMode = new ScaleDownMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new AgentPoolType(property.Value.GetString()); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new AgentPoolMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("orchestratorVersion"u8)) - { - orchestratorVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("currentOrchestratorVersion"u8)) - { - currentOrchestratorVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("nodeImageVersion"u8)) - { - nodeImageVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("upgradeSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeSettings = AgentPoolUpgradeSettings.DeserializeAgentPoolUpgradeSettings(property.Value, options); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - provisioningState = property.Value.GetString(); - continue; - } - if (property.NameEquals("powerState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - powerState = ContainerServicePowerState.DeserializeContainerServicePowerState(property.Value, options); - continue; - } - if (property.NameEquals("availabilityZones"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - availabilityZones = array; - continue; - } - if (property.NameEquals("enableNodePublicIP"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableNodePublicIP = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("nodePublicIPPrefixID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nodePublicIPPrefixId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("scaleSetPriority"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetPriority = new ScaleSetPriority(property.Value.GetString()); - continue; - } - if (property.NameEquals("scaleSetEvictionPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scaleSetEvictionPolicy = new ScaleSetEvictionPolicy(property.Value.GetString()); - continue; - } - if (property.NameEquals("spotMaxPrice"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - spotMaxPrice = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("nodeLabels"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - nodeLabels = dictionary; - continue; - } - if (property.NameEquals("nodeTaints"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nodeTaints = array; - continue; - } - if (property.NameEquals("proximityPlacementGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - proximityPlacementGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("kubeletConfig"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeletConfig = KubeletConfig.DeserializeKubeletConfig(property.Value, options); - continue; - } - if (property.NameEquals("linuxOSConfig"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - linuxOSConfig = LinuxOSConfig.DeserializeLinuxOSConfig(property.Value, options); - continue; - } - if (property.NameEquals("enableEncryptionAtHost"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableEncryptionAtHost = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableUltraSSD"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableUltraSsd = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableFIPS"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFIPS = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("gpuInstanceProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gpuInstanceProfile = new GpuInstanceProfile(property.Value.GetString()); - continue; - } - if (property.NameEquals("creationData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - creationData = ContainerServiceCreationData.DeserializeContainerServiceCreationData(property.Value, options); - continue; - } - if (property.NameEquals("capacityReservationGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityReservationGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("hostGroupID"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - hostGroupId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("networkProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterAgentPoolProfileProperties( - count, - vmSize, - osDiskSizeGB, - osDiskType, - kubeletDiskType, - workloadRuntime, - vnetSubnetId, - podSubnetId, - maxPods, - osType, - osSku, - maxCount, - minCount, - enableAutoScaling, - scaleDownMode, - type, - mode, - orchestratorVersion, - currentOrchestratorVersion, - nodeImageVersion, - upgradeSettings, - provisioningState, - powerState, - availabilityZones ?? new ChangeTrackingList(), - enableNodePublicIP, - nodePublicIPPrefixId, - scaleSetPriority, - scaleSetEvictionPolicy, - spotMaxPrice, - tags ?? new ChangeTrackingDictionary(), - nodeLabels ?? new ChangeTrackingDictionary(), - nodeTaints ?? new ChangeTrackingList(), - proximityPlacementGroupId, - kubeletConfig, - linuxOSConfig, - enableEncryptionAtHost, - enableUltraSsd, - enableFIPS, - gpuInstanceProfile, - creationData, - capacityReservationGroupId, - hostGroupId, - networkProfile, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfileProperties)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterAgentPoolProfileProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAgentPoolProfileProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfileProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs deleted file mode 100644 index 865ae8a4b00b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Properties for the container service agent pool profile. - public partial class ManagedClusterAgentPoolProfileProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterAgentPoolProfileProperties() - { - AvailabilityZones = new ChangeTrackingList(); - Tags = new ChangeTrackingDictionary(); - NodeLabels = new ChangeTrackingDictionary(); - NodeTaints = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - /// Determines the type of workload a node can run. - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - /// The maximum number of pods that can run on a node. - /// The operating system type. The default is Linux. - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - /// The maximum number of nodes for auto-scaling. - /// The minimum number of nodes for auto-scaling. - /// Whether to enable auto-scaler. - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - /// The type of Agent Pool. - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - /// The version of node image. - /// Settings for upgrading the agentpool. - /// The current deployment or provisioning state. - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - /// The tags to be persisted on the agent pool virtual machine scale set. - /// The node labels to be persisted across all nodes in agent pool. - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - /// The ID for Proximity Placement Group. - /// The Kubelet configuration on the agent pool nodes. - /// The OS configuration of Linux agent nodes. - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - /// Whether to enable UltraSSD. - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - /// Network-related settings of an agent pool. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAgentPoolProfileProperties(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) - { - Count = count; - VmSize = vmSize; - OSDiskSizeInGB = osDiskSizeInGB; - OSDiskType = osDiskType; - KubeletDiskType = kubeletDiskType; - WorkloadRuntime = workloadRuntime; - VnetSubnetId = vnetSubnetId; - PodSubnetId = podSubnetId; - MaxPods = maxPods; - OSType = osType; - OSSku = osSku; - MaxCount = maxCount; - MinCount = minCount; - EnableAutoScaling = enableAutoScaling; - ScaleDownMode = scaleDownMode; - AgentPoolType = agentPoolType; - Mode = mode; - OrchestratorVersion = orchestratorVersion; - CurrentOrchestratorVersion = currentOrchestratorVersion; - NodeImageVersion = nodeImageVersion; - UpgradeSettings = upgradeSettings; - ProvisioningState = provisioningState; - PowerState = powerState; - AvailabilityZones = availabilityZones; - EnableNodePublicIP = enableNodePublicIP; - NodePublicIPPrefixId = nodePublicIPPrefixId; - ScaleSetPriority = scaleSetPriority; - ScaleSetEvictionPolicy = scaleSetEvictionPolicy; - SpotMaxPrice = spotMaxPrice; - Tags = tags; - NodeLabels = nodeLabels; - NodeTaints = nodeTaints; - ProximityPlacementGroupId = proximityPlacementGroupId; - KubeletConfig = kubeletConfig; - LinuxOSConfig = linuxOSConfig; - EnableEncryptionAtHost = enableEncryptionAtHost; - EnableUltraSsd = enableUltraSsd; - EnableFips = enableFips; - GpuInstanceProfile = gpuInstanceProfile; - CreationData = creationData; - CapacityReservationGroupId = capacityReservationGroupId; - HostGroupId = hostGroupId; - NetworkProfile = networkProfile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. - public int? Count { get; set; } - /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. - public string VmSize { get; set; } - /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. - public int? OSDiskSizeInGB { get; set; } - /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). - public ContainerServiceOSDiskType? OSDiskType { get; set; } - /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. - public KubeletDiskType? KubeletDiskType { get; set; } - /// Determines the type of workload a node can run. - public WorkloadRuntime? WorkloadRuntime { get; set; } - /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - public ResourceIdentifier VnetSubnetId { get; set; } - /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. - public ResourceIdentifier PodSubnetId { get; set; } - /// The maximum number of pods that can run on a node. - public int? MaxPods { get; set; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType? OSType { get; set; } - /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. - public ContainerServiceOSSku? OSSku { get; set; } - /// The maximum number of nodes for auto-scaling. - public int? MaxCount { get; set; } - /// The minimum number of nodes for auto-scaling. - public int? MinCount { get; set; } - /// Whether to enable auto-scaler. - public bool? EnableAutoScaling { get; set; } - /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. - public ScaleDownMode? ScaleDownMode { get; set; } - /// The type of Agent Pool. - public AgentPoolType? AgentPoolType { get; set; } - /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. - public AgentPoolMode? Mode { get; set; } - /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). - public string OrchestratorVersion { get; set; } - /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. - public string CurrentOrchestratorVersion { get; } - /// The version of node image. - public string NodeImageVersion { get; } - /// Settings for upgrading the agentpool. - public AgentPoolUpgradeSettings UpgradeSettings { get; set; } - /// The current deployment or provisioning state. - public string ProvisioningState { get; } - /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. - internal ContainerServicePowerState PowerState { get; set; } - /// Tells whether the cluster is Running or Stopped. - public ContainerServiceStateCode? PowerStateCode - { - get => PowerState is null ? default : PowerState.Code; - set - { - if (PowerState is null) - PowerState = new ContainerServicePowerState(); - PowerState.Code = value; - } - } - - /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. - public IList AvailabilityZones { get; } - /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. - public bool? EnableNodePublicIP { get; set; } - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - public ResourceIdentifier NodePublicIPPrefixId { get; set; } - /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. - public ScaleSetPriority? ScaleSetPriority { get; set; } - /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. - public ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get; set; } - /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). - public float? SpotMaxPrice { get; set; } - /// The tags to be persisted on the agent pool virtual machine scale set. - public IDictionary Tags { get; } - /// The node labels to be persisted across all nodes in agent pool. - public IDictionary NodeLabels { get; } - /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - public IList NodeTaints { get; } - /// The ID for Proximity Placement Group. - public ResourceIdentifier ProximityPlacementGroupId { get; set; } - /// The Kubelet configuration on the agent pool nodes. - public KubeletConfig KubeletConfig { get; set; } - /// The OS configuration of Linux agent nodes. - public LinuxOSConfig LinuxOSConfig { get; set; } - /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. - public bool? EnableEncryptionAtHost { get; set; } - /// Whether to enable UltraSSD. - public bool? EnableUltraSsd { get; set; } - /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. - public bool? EnableFips { get; set; } - /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - public GpuInstanceProfile? GpuInstanceProfile { get; set; } - /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. - internal ContainerServiceCreationData CreationData { get; set; } - /// This is the ARM ID of the source object to be used to create the target object. - public ResourceIdentifier CreationDataSourceResourceId - { - get => CreationData is null ? default : CreationData.SourceResourceId; - set - { - if (CreationData is null) - CreationData = new ContainerServiceCreationData(); - CreationData.SourceResourceId = value; - } - } - - /// AKS will associate the specified agent pool with the Capacity Reservation Group. - public ResourceIdentifier CapacityReservationGroupId { get; set; } - /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). - public ResourceIdentifier HostGroupId { get; set; } - /// Network-related settings of an agent pool. - public AgentPoolNetworkProfile NetworkProfile { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs deleted file mode 100644 index c1843dd7d7ef..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.Serialization.cs +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterApiServerAccessProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterApiServerAccessProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(AuthorizedIPRanges)) - { - writer.WritePropertyName("authorizedIPRanges"u8); - writer.WriteStartArray(); - foreach (var item in AuthorizedIPRanges) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(EnablePrivateCluster)) - { - writer.WritePropertyName("enablePrivateCluster"u8); - writer.WriteBooleanValue(EnablePrivateCluster.Value); - } - if (Optional.IsDefined(PrivateDnsZone)) - { - writer.WritePropertyName("privateDNSZone"u8); - writer.WriteStringValue(PrivateDnsZone); - } - if (Optional.IsDefined(EnablePrivateClusterPublicFqdn)) - { - writer.WritePropertyName("enablePrivateClusterPublicFQDN"u8); - writer.WriteBooleanValue(EnablePrivateClusterPublicFqdn.Value); - } - if (Optional.IsDefined(DisableRunCommand)) - { - writer.WritePropertyName("disableRunCommand"u8); - writer.WriteBooleanValue(DisableRunCommand.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterApiServerAccessProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterApiServerAccessProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterApiServerAccessProfile(document.RootElement, options); - } - - internal static ManagedClusterApiServerAccessProfile DeserializeManagedClusterApiServerAccessProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList authorizedIPRanges = default; - bool? enablePrivateCluster = default; - string privateDnsZone = default; - bool? enablePrivateClusterPublicFQDN = default; - bool? disableRunCommand = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("authorizedIPRanges"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - authorizedIPRanges = array; - continue; - } - if (property.NameEquals("enablePrivateCluster"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePrivateCluster = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("privateDNSZone"u8)) - { - privateDnsZone = property.Value.GetString(); - continue; - } - if (property.NameEquals("enablePrivateClusterPublicFQDN"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePrivateClusterPublicFQDN = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("disableRunCommand"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - disableRunCommand = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterApiServerAccessProfile( - authorizedIPRanges ?? new ChangeTrackingList(), - enablePrivateCluster, - privateDnsZone, - enablePrivateClusterPublicFQDN, - disableRunCommand, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterApiServerAccessProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterApiServerAccessProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterApiServerAccessProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterApiServerAccessProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs deleted file mode 100644 index 8e84d43b345b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterApiServerAccessProfile.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Access profile for managed cluster API server. - public partial class ManagedClusterApiServerAccessProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterApiServerAccessProfile() - { - AuthorizedIPRanges = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). - /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). - /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'. - /// Whether to create additional public FQDN for private cluster or not. - /// Whether to disable run command for the cluster or not. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterApiServerAccessProfile(IList authorizedIPRanges, bool? enablePrivateCluster, string privateDnsZone, bool? enablePrivateClusterPublicFqdn, bool? disableRunCommand, IDictionary serializedAdditionalRawData) - { - AuthorizedIPRanges = authorizedIPRanges; - EnablePrivateCluster = enablePrivateCluster; - PrivateDnsZone = privateDnsZone; - EnablePrivateClusterPublicFqdn = enablePrivateClusterPublicFqdn; - DisableRunCommand = disableRunCommand; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). - public IList AuthorizedIPRanges { get; } - /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). - public bool? EnablePrivateCluster { get; set; } - /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'. - public string PrivateDnsZone { get; set; } - /// Whether to create additional public FQDN for private cluster or not. - public bool? EnablePrivateClusterPublicFqdn { get; set; } - /// Whether to disable run command for the cluster or not. - public bool? DisableRunCommand { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs deleted file mode 100644 index 4092c1fa1f89..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterAutoScalerProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAutoScalerProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(BalanceSimilarNodeGroups)) - { - writer.WritePropertyName("balance-similar-node-groups"u8); - writer.WriteStringValue(BalanceSimilarNodeGroups); - } - if (Optional.IsDefined(Expander)) - { - writer.WritePropertyName("expander"u8); - writer.WriteStringValue(Expander.Value.ToString()); - } - if (Optional.IsDefined(MaxEmptyBulkDelete)) - { - writer.WritePropertyName("max-empty-bulk-delete"u8); - writer.WriteStringValue(MaxEmptyBulkDelete); - } - if (Optional.IsDefined(MaxGracefulTerminationSec)) - { - writer.WritePropertyName("max-graceful-termination-sec"u8); - writer.WriteStringValue(MaxGracefulTerminationSec); - } - if (Optional.IsDefined(MaxNodeProvisionTime)) - { - writer.WritePropertyName("max-node-provision-time"u8); - writer.WriteStringValue(MaxNodeProvisionTime); - } - if (Optional.IsDefined(MaxTotalUnreadyPercentage)) - { - writer.WritePropertyName("max-total-unready-percentage"u8); - writer.WriteStringValue(MaxTotalUnreadyPercentage); - } - if (Optional.IsDefined(NewPodScaleUpDelay)) - { - writer.WritePropertyName("new-pod-scale-up-delay"u8); - writer.WriteStringValue(NewPodScaleUpDelay); - } - if (Optional.IsDefined(OkTotalUnreadyCount)) - { - writer.WritePropertyName("ok-total-unready-count"u8); - writer.WriteStringValue(OkTotalUnreadyCount); - } - if (Optional.IsDefined(ScanIntervalInSeconds)) - { - writer.WritePropertyName("scan-interval"u8); - writer.WriteStringValue(ScanIntervalInSeconds); - } - if (Optional.IsDefined(ScaleDownDelayAfterAdd)) - { - writer.WritePropertyName("scale-down-delay-after-add"u8); - writer.WriteStringValue(ScaleDownDelayAfterAdd); - } - if (Optional.IsDefined(ScaleDownDelayAfterDelete)) - { - writer.WritePropertyName("scale-down-delay-after-delete"u8); - writer.WriteStringValue(ScaleDownDelayAfterDelete); - } - if (Optional.IsDefined(ScaleDownDelayAfterFailure)) - { - writer.WritePropertyName("scale-down-delay-after-failure"u8); - writer.WriteStringValue(ScaleDownDelayAfterFailure); - } - if (Optional.IsDefined(ScaleDownUnneededTime)) - { - writer.WritePropertyName("scale-down-unneeded-time"u8); - writer.WriteStringValue(ScaleDownUnneededTime); - } - if (Optional.IsDefined(ScaleDownUnreadyTime)) - { - writer.WritePropertyName("scale-down-unready-time"u8); - writer.WriteStringValue(ScaleDownUnreadyTime); - } - if (Optional.IsDefined(ScaleDownUtilizationThreshold)) - { - writer.WritePropertyName("scale-down-utilization-threshold"u8); - writer.WriteStringValue(ScaleDownUtilizationThreshold); - } - if (Optional.IsDefined(SkipNodesWithLocalStorage)) - { - writer.WritePropertyName("skip-nodes-with-local-storage"u8); - writer.WriteStringValue(SkipNodesWithLocalStorage); - } - if (Optional.IsDefined(SkipNodesWithSystemPods)) - { - writer.WritePropertyName("skip-nodes-with-system-pods"u8); - writer.WriteStringValue(SkipNodesWithSystemPods); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAutoScalerProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAutoScalerProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAutoScalerProfile(document.RootElement, options); - } - - internal static ManagedClusterAutoScalerProfile DeserializeManagedClusterAutoScalerProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string balanceSimilarNodeGroups = default; - AutoScaleExpander? expander = default; - string maxEmptyBulkDelete = default; - string maxGracefulTerminationSec = default; - string maxNodeProvisionTime = default; - string maxTotalUnreadyPercentage = default; - string newPodScaleUpDelay = default; - string okTotalUnreadyCount = default; - string scanInterval = default; - string scaleDownDelayAfterAdd = default; - string scaleDownDelayAfterDelete = default; - string scaleDownDelayAfterFailure = default; - string scaleDownUnneededTime = default; - string scaleDownUnreadyTime = default; - string scaleDownUtilizationThreshold = default; - string skipNodesWithLocalStorage = default; - string skipNodesWithSystemPods = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("balance-similar-node-groups"u8)) - { - balanceSimilarNodeGroups = property.Value.GetString(); - continue; - } - if (property.NameEquals("expander"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expander = new AutoScaleExpander(property.Value.GetString()); - continue; - } - if (property.NameEquals("max-empty-bulk-delete"u8)) - { - maxEmptyBulkDelete = property.Value.GetString(); - continue; - } - if (property.NameEquals("max-graceful-termination-sec"u8)) - { - maxGracefulTerminationSec = property.Value.GetString(); - continue; - } - if (property.NameEquals("max-node-provision-time"u8)) - { - maxNodeProvisionTime = property.Value.GetString(); - continue; - } - if (property.NameEquals("max-total-unready-percentage"u8)) - { - maxTotalUnreadyPercentage = property.Value.GetString(); - continue; - } - if (property.NameEquals("new-pod-scale-up-delay"u8)) - { - newPodScaleUpDelay = property.Value.GetString(); - continue; - } - if (property.NameEquals("ok-total-unready-count"u8)) - { - okTotalUnreadyCount = property.Value.GetString(); - continue; - } - if (property.NameEquals("scan-interval"u8)) - { - scanInterval = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-delay-after-add"u8)) - { - scaleDownDelayAfterAdd = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-delay-after-delete"u8)) - { - scaleDownDelayAfterDelete = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-delay-after-failure"u8)) - { - scaleDownDelayAfterFailure = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-unneeded-time"u8)) - { - scaleDownUnneededTime = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-unready-time"u8)) - { - scaleDownUnreadyTime = property.Value.GetString(); - continue; - } - if (property.NameEquals("scale-down-utilization-threshold"u8)) - { - scaleDownUtilizationThreshold = property.Value.GetString(); - continue; - } - if (property.NameEquals("skip-nodes-with-local-storage"u8)) - { - skipNodesWithLocalStorage = property.Value.GetString(); - continue; - } - if (property.NameEquals("skip-nodes-with-system-pods"u8)) - { - skipNodesWithSystemPods = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterAutoScalerProfile( - balanceSimilarNodeGroups, - expander, - maxEmptyBulkDelete, - maxGracefulTerminationSec, - maxNodeProvisionTime, - maxTotalUnreadyPercentage, - newPodScaleUpDelay, - okTotalUnreadyCount, - scanInterval, - scaleDownDelayAfterAdd, - scaleDownDelayAfterDelete, - scaleDownDelayAfterFailure, - scaleDownUnneededTime, - scaleDownUnreadyTime, - scaleDownUtilizationThreshold, - skipNodesWithLocalStorage, - skipNodesWithSystemPods, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterAutoScalerProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterAutoScalerProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAutoScalerProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAutoScalerProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs deleted file mode 100644 index 49c6bef9fb1c..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Parameters to be applied to the cluster-autoscaler when enabled. - public partial class ManagedClusterAutoScalerProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterAutoScalerProfile() - { - } - - /// Initializes a new instance of . - /// Valid values are 'true' and 'false'. - /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. - /// The default is 10. - /// The default is 600. - /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is 45. The maximum is 100 and the minimum is 0. - /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - /// This must be an integer. The default is 3. - /// The default is '10'. Values must be an integer number of seconds. - /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - /// The default is '0.5'. - /// The default is true. - /// The default is true. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAutoScalerProfile(string balanceSimilarNodeGroups, AutoScaleExpander? expander, string maxEmptyBulkDelete, string maxGracefulTerminationSec, string maxNodeProvisionTime, string maxTotalUnreadyPercentage, string newPodScaleUpDelay, string okTotalUnreadyCount, string scanIntervalInSeconds, string scaleDownDelayAfterAdd, string scaleDownDelayAfterDelete, string scaleDownDelayAfterFailure, string scaleDownUnneededTime, string scaleDownUnreadyTime, string scaleDownUtilizationThreshold, string skipNodesWithLocalStorage, string skipNodesWithSystemPods, IDictionary serializedAdditionalRawData) - { - BalanceSimilarNodeGroups = balanceSimilarNodeGroups; - Expander = expander; - MaxEmptyBulkDelete = maxEmptyBulkDelete; - MaxGracefulTerminationSec = maxGracefulTerminationSec; - MaxNodeProvisionTime = maxNodeProvisionTime; - MaxTotalUnreadyPercentage = maxTotalUnreadyPercentage; - NewPodScaleUpDelay = newPodScaleUpDelay; - OkTotalUnreadyCount = okTotalUnreadyCount; - ScanIntervalInSeconds = scanIntervalInSeconds; - ScaleDownDelayAfterAdd = scaleDownDelayAfterAdd; - ScaleDownDelayAfterDelete = scaleDownDelayAfterDelete; - ScaleDownDelayAfterFailure = scaleDownDelayAfterFailure; - ScaleDownUnneededTime = scaleDownUnneededTime; - ScaleDownUnreadyTime = scaleDownUnreadyTime; - ScaleDownUtilizationThreshold = scaleDownUtilizationThreshold; - SkipNodesWithLocalStorage = skipNodesWithLocalStorage; - SkipNodesWithSystemPods = skipNodesWithSystemPods; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Valid values are 'true' and 'false'. - public string BalanceSimilarNodeGroups { get; set; } - /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. - public AutoScaleExpander? Expander { get; set; } - /// The default is 10. - public string MaxEmptyBulkDelete { get; set; } - /// The default is 600. - public string MaxGracefulTerminationSec { get; set; } - /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string MaxNodeProvisionTime { get; set; } - /// The default is 45. The maximum is 100 and the minimum is 0. - public string MaxTotalUnreadyPercentage { get; set; } - /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). - public string NewPodScaleUpDelay { get; set; } - /// This must be an integer. The default is 3. - public string OkTotalUnreadyCount { get; set; } - /// The default is '10'. Values must be an integer number of seconds. - public string ScanIntervalInSeconds { get; set; } - /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownDelayAfterAdd { get; set; } - /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownDelayAfterDelete { get; set; } - /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownDelayAfterFailure { get; set; } - /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownUnneededTime { get; set; } - /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. - public string ScaleDownUnreadyTime { get; set; } - /// The default is '0.5'. - public string ScaleDownUtilizationThreshold { get; set; } - /// The default is true. - public string SkipNodesWithLocalStorage { get; set; } - /// The default is true. - public string SkipNodesWithSystemPods { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.Serialization.cs deleted file mode 100644 index ac9417b4a6f8..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterAutoUpgradeProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAutoUpgradeProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(UpgradeChannel)) - { - writer.WritePropertyName("upgradeChannel"u8); - writer.WriteStringValue(UpgradeChannel.Value.ToString()); - } - if (Optional.IsDefined(NodeOSUpgradeChannel)) - { - writer.WritePropertyName("nodeOSUpgradeChannel"u8); - writer.WriteStringValue(NodeOSUpgradeChannel.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAutoUpgradeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAutoUpgradeProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAutoUpgradeProfile(document.RootElement, options); - } - - internal static ManagedClusterAutoUpgradeProfile DeserializeManagedClusterAutoUpgradeProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - UpgradeChannel? upgradeChannel = default; - ManagedClusterNodeOSUpgradeChannel? nodeOSUpgradeChannel = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("upgradeChannel"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - upgradeChannel = new UpgradeChannel(property.Value.GetString()); - continue; - } - if (property.NameEquals("nodeOSUpgradeChannel"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nodeOSUpgradeChannel = new ManagedClusterNodeOSUpgradeChannel(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterAutoUpgradeProfile(upgradeChannel, nodeOSUpgradeChannel, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterAutoUpgradeProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterAutoUpgradeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAutoUpgradeProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAutoUpgradeProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs deleted file mode 100644 index d44699577bbe..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoUpgradeProfile.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Auto upgrade profile for a managed cluster. - public partial class ManagedClusterAutoUpgradeProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterAutoUpgradeProfile() - { - } - - /// Initializes a new instance of . - /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). - /// Manner in which the OS on your nodes is updated. The default is NodeImage. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAutoUpgradeProfile(UpgradeChannel? upgradeChannel, ManagedClusterNodeOSUpgradeChannel? nodeOSUpgradeChannel, IDictionary serializedAdditionalRawData) - { - UpgradeChannel = upgradeChannel; - NodeOSUpgradeChannel = nodeOSUpgradeChannel; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). - public UpgradeChannel? UpgradeChannel { get; set; } - /// Manner in which the OS on your nodes is updated. The default is NodeImage. - public ManagedClusterNodeOSUpgradeChannel? NodeOSUpgradeChannel { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.Serialization.cs deleted file mode 100644 index 109c2a415678..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterAzureMonitorProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAzureMonitorProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Metrics)) - { - writer.WritePropertyName("metrics"u8); - writer.WriteObjectValue(Metrics, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterAzureMonitorProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterAzureMonitorProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAzureMonitorProfile(document.RootElement, options); - } - - internal static ManagedClusterAzureMonitorProfile DeserializeManagedClusterAzureMonitorProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedClusterMonitorProfileMetrics metrics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metrics"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - metrics = ManagedClusterMonitorProfileMetrics.DeserializeManagedClusterMonitorProfileMetrics(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterAzureMonitorProfile(metrics, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterAzureMonitorProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterAzureMonitorProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAzureMonitorProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterAzureMonitorProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.cs deleted file mode 100644 index fc54e507bed8..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAzureMonitorProfile.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Azure Monitor addon profiles for monitoring the managed cluster. - internal partial class ManagedClusterAzureMonitorProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterAzureMonitorProfile() - { - } - - /// Initializes a new instance of . - /// Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterAzureMonitorProfile(ManagedClusterMonitorProfileMetrics metrics, IDictionary serializedAdditionalRawData) - { - Metrics = metrics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. - public ManagedClusterMonitorProfileMetrics Metrics { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.Serialization.cs deleted file mode 100644 index 5bf83d0229f7..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCredentials.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterCredentials : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterCredentials)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Kubeconfigs)) - { - writer.WritePropertyName("kubeconfigs"u8); - writer.WriteStartArray(); - foreach (var item in Kubeconfigs) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterCredentials)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterCredentials(document.RootElement, options); - } - - internal static ManagedClusterCredentials DeserializeManagedClusterCredentials(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList kubeconfigs = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kubeconfigs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ManagedClusterCredential.DeserializeManagedClusterCredential(item, options)); - } - kubeconfigs = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterCredentials(kubeconfigs ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterCredentials)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterCredentials(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterCredentials)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.cs deleted file mode 100644 index fc5dda7a2409..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Delegated resource properties - internal use only. - public partial class ManagedClusterDelegatedIdentity - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterDelegatedIdentity() - { - } - - /// Initializes a new instance of . - /// The ARM resource id of the delegated resource - internal use only. - /// The tenant id of the delegated resource - internal use only. - /// The delegation id of the referral delegation (optional) - internal use only. - /// The source resource location - internal use only. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterDelegatedIdentity(ResourceIdentifier resourceId, Guid? tenantId, string referralResource, AzureLocation? location, IDictionary serializedAdditionalRawData) - { - ResourceId = resourceId; - TenantId = tenantId; - ReferralResource = referralResource; - Location = location; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The ARM resource id of the delegated resource - internal use only. - public ResourceIdentifier ResourceId { get; set; } - /// The tenant id of the delegated resource - internal use only. - public Guid? TenantId { get; set; } - /// The delegation id of the referral delegation (optional) - internal use only. - public string ReferralResource { get; set; } - /// The source resource location - internal use only. - public AzureLocation? Location { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.Serialization.cs deleted file mode 100644 index 154aa81065d2..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.Serialization.cs +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterHttpProxyConfig : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterHttpProxyConfig)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(HttpProxy)) - { - writer.WritePropertyName("httpProxy"u8); - writer.WriteStringValue(HttpProxy); - } - if (Optional.IsDefined(HttpsProxy)) - { - writer.WritePropertyName("httpsProxy"u8); - writer.WriteStringValue(HttpsProxy); - } - if (Optional.IsCollectionDefined(NoProxy)) - { - writer.WritePropertyName("noProxy"u8); - writer.WriteStartArray(); - foreach (var item in NoProxy) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(TrustedCA)) - { - writer.WritePropertyName("trustedCa"u8); - writer.WriteStringValue(TrustedCA); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterHttpProxyConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterHttpProxyConfig)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterHttpProxyConfig(document.RootElement, options); - } - - internal static ManagedClusterHttpProxyConfig DeserializeManagedClusterHttpProxyConfig(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string httpProxy = default; - string httpsProxy = default; - IList noProxy = default; - string trustedCA = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("httpProxy"u8)) - { - httpProxy = property.Value.GetString(); - continue; - } - if (property.NameEquals("httpsProxy"u8)) - { - httpsProxy = property.Value.GetString(); - continue; - } - if (property.NameEquals("noProxy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - noProxy = array; - continue; - } - if (property.NameEquals("trustedCa"u8)) - { - trustedCA = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterHttpProxyConfig(httpProxy, httpsProxy, noProxy ?? new ChangeTrackingList(), trustedCA, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterHttpProxyConfig)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterHttpProxyConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterHttpProxyConfig(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterHttpProxyConfig)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.cs deleted file mode 100644 index 8a2f7c834cb1..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterHttpProxyConfig.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Cluster HTTP proxy configuration. - public partial class ManagedClusterHttpProxyConfig - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterHttpProxyConfig() - { - NoProxy = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The HTTP proxy server endpoint to use. - /// The HTTPS proxy server endpoint to use. - /// The endpoints that should not go through proxy. - /// Alternative CA cert to use for connecting to proxy servers. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterHttpProxyConfig(string httpProxy, string httpsProxy, IList noProxy, string trustedCA, IDictionary serializedAdditionalRawData) - { - HttpProxy = httpProxy; - HttpsProxy = httpsProxy; - NoProxy = noProxy; - TrustedCA = trustedCA; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The HTTP proxy server endpoint to use. - public string HttpProxy { get; set; } - /// The HTTPS proxy server endpoint to use. - public string HttpsProxy { get; set; } - /// The endpoints that should not go through proxy. - public IList NoProxy { get; } - /// Alternative CA cert to use for connecting to proxy servers. - public string TrustedCA { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterKeyVaultNetworkAccessType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterKeyVaultNetworkAccessType.cs deleted file mode 100644 index 8c119f109e6d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterKeyVaultNetworkAccessType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`. - public readonly partial struct ManagedClusterKeyVaultNetworkAccessType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterKeyVaultNetworkAccessType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PublicValue = "Public"; - private const string PrivateValue = "Private"; - - /// Public. - public static ManagedClusterKeyVaultNetworkAccessType Public { get; } = new ManagedClusterKeyVaultNetworkAccessType(PublicValue); - /// Private. - public static ManagedClusterKeyVaultNetworkAccessType Private { get; } = new ManagedClusterKeyVaultNetworkAccessType(PrivateValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterKeyVaultNetworkAccessType left, ManagedClusterKeyVaultNetworkAccessType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterKeyVaultNetworkAccessType left, ManagedClusterKeyVaultNetworkAccessType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterKeyVaultNetworkAccessType(string value) => new ManagedClusterKeyVaultNetworkAccessType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterKeyVaultNetworkAccessType other && Equals(other); - /// - public bool Equals(ManagedClusterKeyVaultNetworkAccessType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.cs deleted file mode 100644 index 1e21abb032b7..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The response from the List Managed Clusters operation. - internal partial class ManagedClusterListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ManagedClusterListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The list of managed clusters. - /// The URL to get the next set of managed cluster results. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The list of managed clusters. - public IReadOnlyList Value { get; } - /// The URL to get the next set of managed cluster results. - public string NextLink { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerBackendPoolType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerBackendPoolType.cs deleted file mode 100644 index f50a5fe8de9a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerBackendPoolType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The type of the managed inbound Load Balancer BackendPool. - public readonly partial struct ManagedClusterLoadBalancerBackendPoolType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterLoadBalancerBackendPoolType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NodeIPConfigurationValue = "NodeIPConfiguration"; - private const string NodeIPValue = "NodeIP"; - - /// The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. - public static ManagedClusterLoadBalancerBackendPoolType NodeIPConfiguration { get; } = new ManagedClusterLoadBalancerBackendPoolType(NodeIPConfigurationValue); - /// The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. - public static ManagedClusterLoadBalancerBackendPoolType NodeIP { get; } = new ManagedClusterLoadBalancerBackendPoolType(NodeIPValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterLoadBalancerBackendPoolType left, ManagedClusterLoadBalancerBackendPoolType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterLoadBalancerBackendPoolType left, ManagedClusterLoadBalancerBackendPoolType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterLoadBalancerBackendPoolType(string value) => new ManagedClusterLoadBalancerBackendPoolType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterLoadBalancerBackendPoolType other && Equals(other); - /// - public bool Equals(ManagedClusterLoadBalancerBackendPoolType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs deleted file mode 100644 index df1d0785579a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.Serialization.cs +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterLoadBalancerProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ManagedOutboundIPs)) - { - writer.WritePropertyName("managedOutboundIPs"u8); - writer.WriteObjectValue(ManagedOutboundIPs, options); - } - if (Optional.IsDefined(OutboundIPPrefixes)) - { - writer.WritePropertyName("outboundIPPrefixes"u8); - writer.WriteObjectValue(OutboundIPPrefixes, options); - } - if (Optional.IsDefined(OutboundIPs)) - { - writer.WritePropertyName("outboundIPs"u8); - writer.WriteObjectValue(OutboundIPs, options); - } - if (Optional.IsCollectionDefined(EffectiveOutboundIPs)) - { - writer.WritePropertyName("effectiveOutboundIPs"u8); - writer.WriteStartArray(); - foreach (var item in EffectiveOutboundIPs) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(AllocatedOutboundPorts)) - { - writer.WritePropertyName("allocatedOutboundPorts"u8); - writer.WriteNumberValue(AllocatedOutboundPorts.Value); - } - if (Optional.IsDefined(IdleTimeoutInMinutes)) - { - writer.WritePropertyName("idleTimeoutInMinutes"u8); - writer.WriteNumberValue(IdleTimeoutInMinutes.Value); - } - if (Optional.IsDefined(EnableMultipleStandardLoadBalancers)) - { - writer.WritePropertyName("enableMultipleStandardLoadBalancers"u8); - writer.WriteBooleanValue(EnableMultipleStandardLoadBalancers.Value); - } - if (Optional.IsDefined(BackendPoolType)) - { - writer.WritePropertyName("backendPoolType"u8); - writer.WriteStringValue(BackendPoolType.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterLoadBalancerProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterLoadBalancerProfile(document.RootElement, options); - } - - internal static ManagedClusterLoadBalancerProfile DeserializeManagedClusterLoadBalancerProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs = default; - ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes = default; - ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs = default; - IList effectiveOutboundIPs = default; - int? allocatedOutboundPorts = default; - int? idleTimeoutInMinutes = default; - bool? enableMultipleStandardLoadBalancers = default; - ManagedClusterLoadBalancerBackendPoolType? backendPoolType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("managedOutboundIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - managedOutboundIPs = ManagedClusterLoadBalancerProfileManagedOutboundIPs.DeserializeManagedClusterLoadBalancerProfileManagedOutboundIPs(property.Value, options); - continue; - } - if (property.NameEquals("outboundIPPrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - outboundIPPrefixes = ManagedClusterLoadBalancerProfileOutboundIPPrefixes.DeserializeManagedClusterLoadBalancerProfileOutboundIPPrefixes(property.Value, options); - continue; - } - if (property.NameEquals("outboundIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - outboundIPs = ManagedClusterLoadBalancerProfileOutboundIPs.DeserializeManagedClusterLoadBalancerProfileOutboundIPs(property.Value, options); - continue; - } - if (property.NameEquals("effectiveOutboundIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - effectiveOutboundIPs = array; - continue; - } - if (property.NameEquals("allocatedOutboundPorts"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - allocatedOutboundPorts = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("idleTimeoutInMinutes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - idleTimeoutInMinutes = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enableMultipleStandardLoadBalancers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMultipleStandardLoadBalancers = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("backendPoolType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backendPoolType = new ManagedClusterLoadBalancerBackendPoolType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterLoadBalancerProfile( - managedOutboundIPs, - outboundIPPrefixes, - outboundIPs, - effectiveOutboundIPs ?? new ChangeTrackingList(), - allocatedOutboundPorts, - idleTimeoutInMinutes, - enableMultipleStandardLoadBalancers, - backendPoolType, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterLoadBalancerProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterLoadBalancerProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs deleted file mode 100644 index 3484c768de0a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Profile of the managed cluster load balancer. - public partial class ManagedClusterLoadBalancerProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterLoadBalancerProfile() - { - EffectiveOutboundIPs = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Desired managed outbound IPs for the cluster load balancer. - /// Desired outbound IP Prefix resources for the cluster load balancer. - /// Desired outbound IP resources for the cluster load balancer. - /// The effective outbound IP resources of the cluster load balancer. - /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - /// Enable multiple standard load balancers per AKS cluster or not. - /// The type of the managed inbound Load Balancer BackendPool. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs, ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes, ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs, IList effectiveOutboundIPs, int? allocatedOutboundPorts, int? idleTimeoutInMinutes, bool? enableMultipleStandardLoadBalancers, ManagedClusterLoadBalancerBackendPoolType? backendPoolType, IDictionary serializedAdditionalRawData) - { - ManagedOutboundIPs = managedOutboundIPs; - OutboundIPPrefixes = outboundIPPrefixes; - OutboundIPs = outboundIPs; - EffectiveOutboundIPs = effectiveOutboundIPs; - AllocatedOutboundPorts = allocatedOutboundPorts; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - EnableMultipleStandardLoadBalancers = enableMultipleStandardLoadBalancers; - BackendPoolType = backendPoolType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Desired managed outbound IPs for the cluster load balancer. - public ManagedClusterLoadBalancerProfileManagedOutboundIPs ManagedOutboundIPs { get; set; } - /// Desired outbound IP Prefix resources for the cluster load balancer. - internal ManagedClusterLoadBalancerProfileOutboundIPPrefixes OutboundIPPrefixes { get; set; } - /// A list of public IP prefix resources. - public IList OutboundPublicIPPrefixes - { - get - { - if (OutboundIPPrefixes is null) - OutboundIPPrefixes = new ManagedClusterLoadBalancerProfileOutboundIPPrefixes(); - return OutboundIPPrefixes.PublicIPPrefixes; - } - } - - /// Desired outbound IP resources for the cluster load balancer. - internal ManagedClusterLoadBalancerProfileOutboundIPs OutboundIPs { get; set; } - /// A list of public IP resources. - public IList OutboundPublicIPs - { - get - { - if (OutboundIPs is null) - OutboundIPs = new ManagedClusterLoadBalancerProfileOutboundIPs(); - return OutboundIPs.PublicIPs; - } - } - - /// The effective outbound IP resources of the cluster load balancer. - public IList EffectiveOutboundIPs { get; } - /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. - public int? AllocatedOutboundPorts { get; set; } - /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. - public int? IdleTimeoutInMinutes { get; set; } - /// Enable multiple standard load balancers per AKS cluster or not. - public bool? EnableMultipleStandardLoadBalancers { get; set; } - /// The type of the managed inbound Load Balancer BackendPool. - public ManagedClusterLoadBalancerBackendPoolType? BackendPoolType { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.Serialization.cs deleted file mode 100644 index 00fe41e5f958..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileManagedOutboundIPs)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(CountIPv6)) - { - writer.WritePropertyName("countIPv6"u8); - writer.WriteNumberValue(CountIPv6.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterLoadBalancerProfileManagedOutboundIPs IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileManagedOutboundIPs)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterLoadBalancerProfileManagedOutboundIPs(document.RootElement, options); - } - - internal static ManagedClusterLoadBalancerProfileManagedOutboundIPs DeserializeManagedClusterLoadBalancerProfileManagedOutboundIPs(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? count = default; - int? countIPv6 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("count"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("countIPv6"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - countIPv6 = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterLoadBalancerProfileManagedOutboundIPs(count, countIPv6, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileManagedOutboundIPs)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterLoadBalancerProfileManagedOutboundIPs IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterLoadBalancerProfileManagedOutboundIPs(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileManagedOutboundIPs)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs deleted file mode 100644 index ea9437cfd930..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Desired managed outbound IPs for the cluster load balancer. - public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterLoadBalancerProfileManagedOutboundIPs() - { - } - - /// Initializes a new instance of . - /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterLoadBalancerProfileManagedOutboundIPs(int? count, int? countIPv6, IDictionary serializedAdditionalRawData) - { - Count = count; - CountIPv6 = countIPv6; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - public int? Count { get; set; } - /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. - public int? CountIPv6 { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.Serialization.cs deleted file mode 100644 index feadf5ed8495..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPPrefixes)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(PublicIPPrefixes)) - { - writer.WritePropertyName("publicIPPrefixes"u8); - writer.WriteStartArray(); - foreach (var item in PublicIPPrefixes) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterLoadBalancerProfileOutboundIPPrefixes IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPPrefixes)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterLoadBalancerProfileOutboundIPPrefixes(document.RootElement, options); - } - - internal static ManagedClusterLoadBalancerProfileOutboundIPPrefixes DeserializeManagedClusterLoadBalancerProfileOutboundIPPrefixes(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList publicIPPrefixes = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("publicIPPrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - publicIPPrefixes = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterLoadBalancerProfileOutboundIPPrefixes(publicIPPrefixes ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPPrefixes)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterLoadBalancerProfileOutboundIPPrefixes IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterLoadBalancerProfileOutboundIPPrefixes(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPPrefixes)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs deleted file mode 100644 index 9ac8bc34055d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Desired outbound IP Prefix resources for the cluster load balancer. - internal partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterLoadBalancerProfileOutboundIPPrefixes() - { - PublicIPPrefixes = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// A list of public IP prefix resources. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterLoadBalancerProfileOutboundIPPrefixes(IList publicIPPrefixes, IDictionary serializedAdditionalRawData) - { - PublicIPPrefixes = publicIPPrefixes; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A list of public IP prefix resources. - public IList PublicIPPrefixes { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.Serialization.cs deleted file mode 100644 index a845f640fc76..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterLoadBalancerProfileOutboundIPs : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPs)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(PublicIPs)) - { - writer.WritePropertyName("publicIPs"u8); - writer.WriteStartArray(); - foreach (var item in PublicIPs) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterLoadBalancerProfileOutboundIPs IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPs)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterLoadBalancerProfileOutboundIPs(document.RootElement, options); - } - - internal static ManagedClusterLoadBalancerProfileOutboundIPs DeserializeManagedClusterLoadBalancerProfileOutboundIPs(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList publicIPs = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("publicIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - publicIPs = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterLoadBalancerProfileOutboundIPs(publicIPs ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPs)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterLoadBalancerProfileOutboundIPs IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterLoadBalancerProfileOutboundIPs(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterLoadBalancerProfileOutboundIPs)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs deleted file mode 100644 index b318991a9002..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Desired outbound IP resources for the cluster load balancer. - internal partial class ManagedClusterLoadBalancerProfileOutboundIPs - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterLoadBalancerProfileOutboundIPs() - { - PublicIPs = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// A list of public IP resources. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterLoadBalancerProfileOutboundIPs(IList publicIPs, IDictionary serializedAdditionalRawData) - { - PublicIPs = publicIPs; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A list of public IP resources. - public IList PublicIPs { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.Serialization.cs deleted file mode 100644 index 241bdf72aa7f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterManagedOutboundIPProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterManagedOutboundIPProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterManagedOutboundIPProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterManagedOutboundIPProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterManagedOutboundIPProfile(document.RootElement, options); - } - - internal static ManagedClusterManagedOutboundIPProfile DeserializeManagedClusterManagedOutboundIPProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? count = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("count"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterManagedOutboundIPProfile(count, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterManagedOutboundIPProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterManagedOutboundIPProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterManagedOutboundIPProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterManagedOutboundIPProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.Serialization.cs deleted file mode 100644 index 6ece4ab29a57..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.Serialization.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterMonitorProfileKubeStateMetrics : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileKubeStateMetrics)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(MetricLabelsAllowlist)) - { - writer.WritePropertyName("metricLabelsAllowlist"u8); - writer.WriteStringValue(MetricLabelsAllowlist); - } - if (Optional.IsDefined(MetricAnnotationsAllowList)) - { - writer.WritePropertyName("metricAnnotationsAllowList"u8); - writer.WriteStringValue(MetricAnnotationsAllowList); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterMonitorProfileKubeStateMetrics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileKubeStateMetrics)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterMonitorProfileKubeStateMetrics(document.RootElement, options); - } - - internal static ManagedClusterMonitorProfileKubeStateMetrics DeserializeManagedClusterMonitorProfileKubeStateMetrics(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string metricLabelsAllowlist = default; - string metricAnnotationsAllowList = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metricLabelsAllowlist"u8)) - { - metricLabelsAllowlist = property.Value.GetString(); - continue; - } - if (property.NameEquals("metricAnnotationsAllowList"u8)) - { - metricAnnotationsAllowList = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterMonitorProfileKubeStateMetrics(metricLabelsAllowlist, metricAnnotationsAllowList, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileKubeStateMetrics)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterMonitorProfileKubeStateMetrics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterMonitorProfileKubeStateMetrics(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileKubeStateMetrics)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.cs deleted file mode 100644 index c24e722f1e1f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileKubeStateMetrics.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are for the kube-state-metrics pod that is deployed with the addon. See aka.ms/AzureManagedPrometheus-optional-parameters for details. - public partial class ManagedClusterMonitorProfileKubeStateMetrics - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterMonitorProfileKubeStateMetrics() - { - } - - /// Initializes a new instance of . - /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric (Example: 'namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...'). By default the metric contains only resource name and namespace labels. - /// Comma-separated list of Kubernetes annotation keys that will be used in the resource's labels metric (Example: 'namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...'). By default the metric contains only resource name and namespace labels. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterMonitorProfileKubeStateMetrics(string metricLabelsAllowlist, string metricAnnotationsAllowList, IDictionary serializedAdditionalRawData) - { - MetricLabelsAllowlist = metricLabelsAllowlist; - MetricAnnotationsAllowList = metricAnnotationsAllowList; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric (Example: 'namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...'). By default the metric contains only resource name and namespace labels. - public string MetricLabelsAllowlist { get; set; } - /// Comma-separated list of Kubernetes annotation keys that will be used in the resource's labels metric (Example: 'namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...'). By default the metric contains only resource name and namespace labels. - public string MetricAnnotationsAllowList { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.Serialization.cs deleted file mode 100644 index c5ac227d1c0b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.Serialization.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterMonitorProfileMetrics : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileMetrics)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled); - if (Optional.IsDefined(KubeStateMetrics)) - { - writer.WritePropertyName("kubeStateMetrics"u8); - writer.WriteObjectValue(KubeStateMetrics, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterMonitorProfileMetrics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileMetrics)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterMonitorProfileMetrics(document.RootElement, options); - } - - internal static ManagedClusterMonitorProfileMetrics DeserializeManagedClusterMonitorProfileMetrics(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool enabled = default; - ManagedClusterMonitorProfileKubeStateMetrics kubeStateMetrics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("kubeStateMetrics"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeStateMetrics = ManagedClusterMonitorProfileKubeStateMetrics.DeserializeManagedClusterMonitorProfileKubeStateMetrics(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterMonitorProfileMetrics(enabled, kubeStateMetrics, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileMetrics)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterMonitorProfileMetrics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterMonitorProfileMetrics(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterMonitorProfileMetrics)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.cs deleted file mode 100644 index 545b9ef80851..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMonitorProfileMetrics.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. - public partial class ManagedClusterMonitorProfileMetrics - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Whether to enable or disable the Azure Managed Prometheus addon for Prometheus monitoring. See aka.ms/AzureManagedPrometheus-aks-enable for details on enabling and disabling. - public ManagedClusterMonitorProfileMetrics(bool isEnabled) - { - IsEnabled = isEnabled; - } - - /// Initializes a new instance of . - /// Whether to enable or disable the Azure Managed Prometheus addon for Prometheus monitoring. See aka.ms/AzureManagedPrometheus-aks-enable for details on enabling and disabling. - /// Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are for the kube-state-metrics pod that is deployed with the addon. See aka.ms/AzureManagedPrometheus-optional-parameters for details. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterMonitorProfileMetrics(bool isEnabled, ManagedClusterMonitorProfileKubeStateMetrics kubeStateMetrics, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - KubeStateMetrics = kubeStateMetrics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterMonitorProfileMetrics() - { - } - - /// Whether to enable or disable the Azure Managed Prometheus addon for Prometheus monitoring. See aka.ms/AzureManagedPrometheus-aks-enable for details on enabling and disabling. - public bool IsEnabled { get; set; } - /// Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are for the kube-state-metrics pod that is deployed with the addon. See aka.ms/AzureManagedPrometheus-optional-parameters for details. - public ManagedClusterMonitorProfileKubeStateMetrics KubeStateMetrics { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs deleted file mode 100644 index d89ee4cbd722..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.Serialization.cs +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterNatGatewayProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterNatGatewayProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ManagedOutboundIPProfile)) - { - writer.WritePropertyName("managedOutboundIPProfile"u8); - writer.WriteObjectValue(ManagedOutboundIPProfile, options); - } - if (Optional.IsCollectionDefined(EffectiveOutboundIPs)) - { - writer.WritePropertyName("effectiveOutboundIPs"u8); - writer.WriteStartArray(); - foreach (var item in EffectiveOutboundIPs) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(IdleTimeoutInMinutes)) - { - writer.WritePropertyName("idleTimeoutInMinutes"u8); - writer.WriteNumberValue(IdleTimeoutInMinutes.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterNatGatewayProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterNatGatewayProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterNatGatewayProfile(document.RootElement, options); - } - - internal static ManagedClusterNatGatewayProfile DeserializeManagedClusterNatGatewayProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedClusterManagedOutboundIPProfile managedOutboundIPProfile = default; - IList effectiveOutboundIPs = default; - int? idleTimeoutInMinutes = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("managedOutboundIPProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - managedOutboundIPProfile = ManagedClusterManagedOutboundIPProfile.DeserializeManagedClusterManagedOutboundIPProfile(property.Value, options); - continue; - } - if (property.NameEquals("effectiveOutboundIPs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - effectiveOutboundIPs = array; - continue; - } - if (property.NameEquals("idleTimeoutInMinutes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - idleTimeoutInMinutes = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterNatGatewayProfile(managedOutboundIPProfile, effectiveOutboundIPs ?? new ChangeTrackingList(), idleTimeoutInMinutes, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterNatGatewayProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterNatGatewayProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterNatGatewayProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterNatGatewayProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs deleted file mode 100644 index 0584ea14ef39..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNatGatewayProfile.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Profile of the managed cluster NAT gateway. - public partial class ManagedClusterNatGatewayProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterNatGatewayProfile() - { - EffectiveOutboundIPs = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Profile of the managed outbound IP resources of the cluster NAT gateway. - /// The effective outbound IP resources of the cluster NAT gateway. - /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterNatGatewayProfile(ManagedClusterManagedOutboundIPProfile managedOutboundIPProfile, IList effectiveOutboundIPs, int? idleTimeoutInMinutes, IDictionary serializedAdditionalRawData) - { - ManagedOutboundIPProfile = managedOutboundIPProfile; - EffectiveOutboundIPs = effectiveOutboundIPs; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Profile of the managed outbound IP resources of the cluster NAT gateway. - internal ManagedClusterManagedOutboundIPProfile ManagedOutboundIPProfile { get; set; } - /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. - public int? ManagedOutboundIPCount - { - get => ManagedOutboundIPProfile is null ? default : ManagedOutboundIPProfile.Count; - set - { - if (ManagedOutboundIPProfile is null) - ManagedOutboundIPProfile = new ManagedClusterManagedOutboundIPProfile(); - ManagedOutboundIPProfile.Count = value; - } - } - - /// The effective outbound IP resources of the cluster NAT gateway. - public IList EffectiveOutboundIPs { get; } - /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - public int? IdleTimeoutInMinutes { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs deleted file mode 100644 index fa41438c4532..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Manner in which the OS on your nodes is updated. The default is NodeImage. - public readonly partial struct ManagedClusterNodeOSUpgradeChannel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterNodeOSUpgradeChannel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string UnmanagedValue = "Unmanaged"; - private const string NodeImageValue = "NodeImage"; - - /// No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means you are responsible for your security updates. - public static ManagedClusterNodeOSUpgradeChannel None { get; } = new ManagedClusterNodeOSUpgradeChannel(NoneValue); - /// OS updates will be applied automatically through the OS built-in patching infrastructure. Newly scaled in machines will be unpatched initially and will be patched at some point by the OS's infrastructure. Behavior of this option depends on the OS in question. Ubuntu and Mariner apply security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows does not apply security patches automatically and so for them this option is equivalent to None till further notice. - public static ManagedClusterNodeOSUpgradeChannel Unmanaged { get; } = new ManagedClusterNodeOSUpgradeChannel(UnmanagedValue); - /// AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option as AKS hosts the images. - public static ManagedClusterNodeOSUpgradeChannel NodeImage { get; } = new ManagedClusterNodeOSUpgradeChannel(NodeImageValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterNodeOSUpgradeChannel left, ManagedClusterNodeOSUpgradeChannel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterNodeOSUpgradeChannel left, ManagedClusterNodeOSUpgradeChannel right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterNodeOSUpgradeChannel(string value) => new ManagedClusterNodeOSUpgradeChannel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterNodeOSUpgradeChannel other && Equals(other); - /// - public bool Equals(ManagedClusterNodeOSUpgradeChannel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.Serialization.cs deleted file mode 100644 index 274b4e6cea7d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterOidcIssuerProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterOidcIssuerProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(IssuerUriInfo)) - { - writer.WritePropertyName("issuerURL"u8); - writer.WriteStringValue(IssuerUriInfo); - } - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterOidcIssuerProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterOidcIssuerProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterOidcIssuerProfile(document.RootElement, options); - } - - internal static ManagedClusterOidcIssuerProfile DeserializeManagedClusterOidcIssuerProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string issuerUrl = default; - bool? enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("issuerURL"u8)) - { - issuerUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterOidcIssuerProfile(issuerUrl, enabled, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterOidcIssuerProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterOidcIssuerProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterOidcIssuerProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterOidcIssuerProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.cs deleted file mode 100644 index ce6f2d2bcf02..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterOidcIssuerProfile.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The OIDC issuer profile of the Managed Cluster. - public partial class ManagedClusterOidcIssuerProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterOidcIssuerProfile() - { - } - - /// Initializes a new instance of . - /// The OIDC issuer url of the Managed Cluster. - /// Whether the OIDC issuer is enabled. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterOidcIssuerProfile(string issuerUriInfo, bool? isEnabled, IDictionary serializedAdditionalRawData) - { - IssuerUriInfo = issuerUriInfo; - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The OIDC issuer url of the Managed Cluster. - public string IssuerUriInfo { get; } - /// Whether the OIDC issuer is enabled. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.Serialization.cs deleted file mode 100644 index a40b07beb46c..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.Serialization.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterPodIdentity : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentity)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("namespace"u8); - writer.WriteStringValue(Namespace); - if (Optional.IsDefined(BindingSelector)) - { - writer.WritePropertyName("bindingSelector"u8); - writer.WriteStringValue(BindingSelector); - } - writer.WritePropertyName("identity"u8); - writer.WriteObjectValue(Identity, options); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningInfo)) - { - writer.WritePropertyName("provisioningInfo"u8); - writer.WriteObjectValue(ProvisioningInfo, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentity)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentity(document.RootElement, options); - } - - internal static ManagedClusterPodIdentity DeserializeManagedClusterPodIdentity(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - string @namespace = default; - string bindingSelector = default; - ContainerServiceUserAssignedIdentity identity = default; - ManagedClusterPodIdentityProvisioningState? provisioningState = default; - ManagedClusterPodIdentityProvisioningInfo provisioningInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("namespace"u8)) - { - @namespace = property.Value.GetString(); - continue; - } - if (property.NameEquals("bindingSelector"u8)) - { - bindingSelector = property.Value.GetString(); - continue; - } - if (property.NameEquals("identity"u8)) - { - identity = ContainerServiceUserAssignedIdentity.DeserializeContainerServiceUserAssignedIdentity(property.Value, options); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new ManagedClusterPodIdentityProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("provisioningInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningInfo = ManagedClusterPodIdentityProvisioningInfo.DeserializeManagedClusterPodIdentityProvisioningInfo(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterPodIdentity( - name, - @namespace, - bindingSelector, - identity, - provisioningState, - provisioningInfo, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentity)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterPodIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterPodIdentity(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentity)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs deleted file mode 100644 index a7e842fbda04..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentity.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Details about the pod identity assigned to the Managed Cluster. - public partial class ManagedClusterPodIdentity - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The name of the pod identity. - /// The namespace of the pod identity. - /// The user assigned identity details. - /// , or is null. - public ManagedClusterPodIdentity(string name, string @namespace, ContainerServiceUserAssignedIdentity identity) - { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(@namespace, nameof(@namespace)); - Argument.AssertNotNull(identity, nameof(identity)); - - Name = name; - Namespace = @namespace; - Identity = identity; - } - - /// Initializes a new instance of . - /// The name of the pod identity. - /// The namespace of the pod identity. - /// The binding selector to use for the AzureIdentityBinding resource. - /// The user assigned identity details. - /// The current provisioning state of the pod identity. - /// - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPodIdentity(string name, string @namespace, string bindingSelector, ContainerServiceUserAssignedIdentity identity, ManagedClusterPodIdentityProvisioningState? provisioningState, ManagedClusterPodIdentityProvisioningInfo provisioningInfo, IDictionary serializedAdditionalRawData) - { - Name = name; - Namespace = @namespace; - BindingSelector = bindingSelector; - Identity = identity; - ProvisioningState = provisioningState; - ProvisioningInfo = provisioningInfo; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterPodIdentity() - { - } - - /// The name of the pod identity. - public string Name { get; set; } - /// The namespace of the pod identity. - public string Namespace { get; set; } - /// The binding selector to use for the AzureIdentityBinding resource. - public string BindingSelector { get; set; } - /// The user assigned identity details. - public ContainerServiceUserAssignedIdentity Identity { get; set; } - /// The current provisioning state of the pod identity. - public ManagedClusterPodIdentityProvisioningState? ProvisioningState { get; } - /// Gets the provisioning info. - internal ManagedClusterPodIdentityProvisioningInfo ProvisioningInfo { get; } - /// Details about the error. - public ResponseError ErrorDetail - { - get => ProvisioningInfo?.ErrorDetail; - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.Serialization.cs deleted file mode 100644 index 44afc5820fc9..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.Serialization.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterPodIdentityException : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityException)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("namespace"u8); - writer.WriteStringValue(Namespace); - writer.WritePropertyName("podLabels"u8); - writer.WriteStartObject(); - foreach (var item in PodLabels) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentityException IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityException)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentityException(document.RootElement, options); - } - - internal static ManagedClusterPodIdentityException DeserializeManagedClusterPodIdentityException(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - string @namespace = default; - IDictionary podLabels = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("namespace"u8)) - { - @namespace = property.Value.GetString(); - continue; - } - if (property.NameEquals("podLabels"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - podLabels = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterPodIdentityException(name, @namespace, podLabels, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityException)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterPodIdentityException IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterPodIdentityException(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityException)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs deleted file mode 100644 index 3b9bd8cc4944..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityException.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// See [disable AAD Pod Identity for a specific Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) for more details. - public partial class ManagedClusterPodIdentityException - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The name of the pod identity exception. - /// The namespace of the pod identity exception. - /// The pod labels to match. - /// , or is null. - public ManagedClusterPodIdentityException(string name, string @namespace, IDictionary podLabels) - { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(@namespace, nameof(@namespace)); - Argument.AssertNotNull(podLabels, nameof(podLabels)); - - Name = name; - Namespace = @namespace; - PodLabels = podLabels; - } - - /// Initializes a new instance of . - /// The name of the pod identity exception. - /// The namespace of the pod identity exception. - /// The pod labels to match. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPodIdentityException(string name, string @namespace, IDictionary podLabels, IDictionary serializedAdditionalRawData) - { - Name = name; - Namespace = @namespace; - PodLabels = podLabels; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterPodIdentityException() - { - } - - /// The name of the pod identity exception. - public string Name { get; set; } - /// The namespace of the pod identity exception. - public string Namespace { get; set; } - /// The pod labels to match. - public IDictionary PodLabels { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.Serialization.cs deleted file mode 100644 index 0aac86ac4bae..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.Serialization.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterPodIdentityProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(AllowNetworkPluginKubenet)) - { - writer.WritePropertyName("allowNetworkPluginKubenet"u8); - writer.WriteBooleanValue(AllowNetworkPluginKubenet.Value); - } - if (Optional.IsCollectionDefined(UserAssignedIdentities)) - { - writer.WritePropertyName("userAssignedIdentities"u8); - writer.WriteStartArray(); - foreach (var item in UserAssignedIdentities) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(UserAssignedIdentityExceptions)) - { - writer.WritePropertyName("userAssignedIdentityExceptions"u8); - writer.WriteStartArray(); - foreach (var item in UserAssignedIdentityExceptions) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentityProfile(document.RootElement, options); - } - - internal static ManagedClusterPodIdentityProfile DeserializeManagedClusterPodIdentityProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? enabled = default; - bool? allowNetworkPluginKubenet = default; - IList userAssignedIdentities = default; - IList userAssignedIdentityExceptions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("allowNetworkPluginKubenet"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - allowNetworkPluginKubenet = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("userAssignedIdentities"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ManagedClusterPodIdentity.DeserializeManagedClusterPodIdentity(item, options)); - } - userAssignedIdentities = array; - continue; - } - if (property.NameEquals("userAssignedIdentityExceptions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ManagedClusterPodIdentityException.DeserializeManagedClusterPodIdentityException(item, options)); - } - userAssignedIdentityExceptions = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterPodIdentityProfile(enabled, allowNetworkPluginKubenet, userAssignedIdentities ?? new ChangeTrackingList(), userAssignedIdentityExceptions ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterPodIdentityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterPodIdentityProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs deleted file mode 100644 index 7a6c9d4b7644..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProfile.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod identity integration. - public partial class ManagedClusterPodIdentityProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterPodIdentityProfile() - { - UserAssignedIdentities = new ChangeTrackingList(); - UserAssignedIdentityExceptions = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Whether the pod identity addon is enabled. - /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information. - /// The pod identities to use in the cluster. - /// The pod identity exceptions to allow. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPodIdentityProfile(bool? isEnabled, bool? allowNetworkPluginKubenet, IList userAssignedIdentities, IList userAssignedIdentityExceptions, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - AllowNetworkPluginKubenet = allowNetworkPluginKubenet; - UserAssignedIdentities = userAssignedIdentities; - UserAssignedIdentityExceptions = userAssignedIdentityExceptions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether the pod identity addon is enabled. - public bool? IsEnabled { get; set; } - /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information. - public bool? AllowNetworkPluginKubenet { get; set; } - /// The pod identities to use in the cluster. - public IList UserAssignedIdentities { get; } - /// The pod identity exceptions to allow. - public IList UserAssignedIdentityExceptions { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.Serialization.cs deleted file mode 100644 index 678728771e66..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterPodIdentityProvisioningError : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningError)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ErrorDetail)) - { - writer.WritePropertyName("error"u8); - JsonSerializer.Serialize(writer, ErrorDetail); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentityProvisioningError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningError)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentityProvisioningError(document.RootElement, options); - } - - internal static ManagedClusterPodIdentityProvisioningError DeserializeManagedClusterPodIdentityProvisioningError(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResponseError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterPodIdentityProvisioningError(error, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningError)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterPodIdentityProvisioningError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterPodIdentityProvisioningError(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningError)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.cs deleted file mode 100644 index 4ed69adee81a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningError.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// An error response from the pod identity provisioning. - internal partial class ManagedClusterPodIdentityProvisioningError - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ManagedClusterPodIdentityProvisioningError() - { - } - - /// Initializes a new instance of . - /// Details about the error. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPodIdentityProvisioningError(ResponseError errorDetail, IDictionary serializedAdditionalRawData) - { - ErrorDetail = errorDetail; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Details about the error. - public ResponseError ErrorDetail { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.Serialization.cs deleted file mode 100644 index 23aa5553b7cc..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterPodIdentityProvisioningInfo : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningInfo)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPodIdentityProvisioningInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningInfo)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPodIdentityProvisioningInfo(document.RootElement, options); - } - - internal static ManagedClusterPodIdentityProvisioningInfo DeserializeManagedClusterPodIdentityProvisioningInfo(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedClusterPodIdentityProvisioningError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = ManagedClusterPodIdentityProvisioningError.DeserializeManagedClusterPodIdentityProvisioningError(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterPodIdentityProvisioningInfo(error, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningInfo)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterPodIdentityProvisioningInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterPodIdentityProvisioningInfo(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPodIdentityProvisioningInfo)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs deleted file mode 100644 index 4d41b3885f1e..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningState.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The current provisioning state of the pod identity. - public readonly partial struct ManagedClusterPodIdentityProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterPodIdentityProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AssignedValue = "Assigned"; - private const string CanceledValue = "Canceled"; - private const string DeletingValue = "Deleting"; - private const string FailedValue = "Failed"; - private const string SucceededValue = "Succeeded"; - private const string UpdatingValue = "Updating"; - - /// Assigned. - public static ManagedClusterPodIdentityProvisioningState Assigned { get; } = new ManagedClusterPodIdentityProvisioningState(AssignedValue); - /// Canceled. - public static ManagedClusterPodIdentityProvisioningState Canceled { get; } = new ManagedClusterPodIdentityProvisioningState(CanceledValue); - /// Deleting. - public static ManagedClusterPodIdentityProvisioningState Deleting { get; } = new ManagedClusterPodIdentityProvisioningState(DeletingValue); - /// Failed. - public static ManagedClusterPodIdentityProvisioningState Failed { get; } = new ManagedClusterPodIdentityProvisioningState(FailedValue); - /// Succeeded. - public static ManagedClusterPodIdentityProvisioningState Succeeded { get; } = new ManagedClusterPodIdentityProvisioningState(SucceededValue); - /// Updating. - public static ManagedClusterPodIdentityProvisioningState Updating { get; } = new ManagedClusterPodIdentityProvisioningState(UpdatingValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterPodIdentityProvisioningState left, ManagedClusterPodIdentityProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterPodIdentityProvisioningState left, ManagedClusterPodIdentityProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterPodIdentityProvisioningState(string value) => new ManagedClusterPodIdentityProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterPodIdentityProvisioningState other && Equals(other); - /// - public bool Equals(ManagedClusterPodIdentityProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.Serialization.cs deleted file mode 100644 index 2a930d2d5289..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterPoolUpgradeProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType.ToString()); - if (Optional.IsCollectionDefined(Upgrades)) - { - writer.WritePropertyName("upgrades"u8); - writer.WriteStartArray(); - foreach (var item in Upgrades) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPoolUpgradeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPoolUpgradeProfile(document.RootElement, options); - } - - internal static ManagedClusterPoolUpgradeProfile DeserializeManagedClusterPoolUpgradeProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string kubernetesVersion = default; - string name = default; - ContainerServiceOSType osType = default; - IReadOnlyList upgrades = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("osType"u8)) - { - osType = new ContainerServiceOSType(property.Value.GetString()); - continue; - } - if (property.NameEquals("upgrades"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ManagedClusterPoolUpgradeProfileUpgradesItem.DeserializeManagedClusterPoolUpgradeProfileUpgradesItem(item, options)); - } - upgrades = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterPoolUpgradeProfile(kubernetesVersion, name, osType, upgrades ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterPoolUpgradeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterPoolUpgradeProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.cs deleted file mode 100644 index e5d6810150f7..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfile.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The list of available upgrade versions. - public partial class ManagedClusterPoolUpgradeProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// The operating system type. The default is Linux. - /// is null. - internal ManagedClusterPoolUpgradeProfile(string kubernetesVersion, ContainerServiceOSType osType) - { - Argument.AssertNotNull(kubernetesVersion, nameof(kubernetesVersion)); - - KubernetesVersion = kubernetesVersion; - OSType = osType; - Upgrades = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// The Agent Pool name. - /// The operating system type. The default is Linux. - /// List of orchestrator types and versions available for upgrade. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterPoolUpgradeProfile(string kubernetesVersion, string name, ContainerServiceOSType osType, IReadOnlyList upgrades, IDictionary serializedAdditionalRawData) - { - KubernetesVersion = kubernetesVersion; - Name = name; - OSType = osType; - Upgrades = upgrades; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterPoolUpgradeProfile() - { - } - - /// The Kubernetes version (major.minor.patch). - public string KubernetesVersion { get; } - /// The Agent Pool name. - public string Name { get; } - /// The operating system type. The default is Linux. - public ContainerServiceOSType OSType { get; } - /// List of orchestrator types and versions available for upgrade. - public IReadOnlyList Upgrades { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.Serialization.cs deleted file mode 100644 index b58b726943b4..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterPoolUpgradeProfileUpgradesItem : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfileUpgradesItem)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(KubernetesVersion)) - { - writer.WritePropertyName("kubernetesVersion"u8); - writer.WriteStringValue(KubernetesVersion); - } - if (Optional.IsDefined(IsPreview)) - { - writer.WritePropertyName("isPreview"u8); - writer.WriteBooleanValue(IsPreview.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterPoolUpgradeProfileUpgradesItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfileUpgradesItem)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterPoolUpgradeProfileUpgradesItem(document.RootElement, options); - } - - internal static ManagedClusterPoolUpgradeProfileUpgradesItem DeserializeManagedClusterPoolUpgradeProfileUpgradesItem(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string kubernetesVersion = default; - bool? isPreview = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kubernetesVersion"u8)) - { - kubernetesVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("isPreview"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterPoolUpgradeProfileUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfileUpgradesItem)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterPoolUpgradeProfileUpgradesItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterPoolUpgradeProfileUpgradesItem(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterPoolUpgradeProfileUpgradesItem)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.Serialization.cs deleted file mode 100644 index 1c42d6a5c68c..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterRunCommandContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterRunCommandContent)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("command"u8); - writer.WriteStringValue(Command); - if (Optional.IsDefined(Context)) - { - writer.WritePropertyName("context"u8); - writer.WriteStringValue(Context); - } - if (Optional.IsDefined(ClusterToken)) - { - writer.WritePropertyName("clusterToken"u8); - writer.WriteStringValue(ClusterToken); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterRunCommandContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterRunCommandContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterRunCommandContent(document.RootElement, options); - } - - internal static ManagedClusterRunCommandContent DeserializeManagedClusterRunCommandContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string command = default; - string context = default; - string clusterToken = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("command"u8)) - { - command = property.Value.GetString(); - continue; - } - if (property.NameEquals("context"u8)) - { - context = property.Value.GetString(); - continue; - } - if (property.NameEquals("clusterToken"u8)) - { - clusterToken = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterRunCommandContent(command, context, clusterToken, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterRunCommandContent)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterRunCommandContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterRunCommandContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterRunCommandContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.Serialization.cs deleted file mode 100644 index 013c16bff46f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.Serialization.cs +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterRunCommandResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterRunCommandResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (options.Format != "W" && Optional.IsDefined(ExitCode)) - { - writer.WritePropertyName("exitCode"u8); - writer.WriteNumberValue(ExitCode.Value); - } - if (options.Format != "W" && Optional.IsDefined(StartedOn)) - { - writer.WritePropertyName("startedAt"u8); - writer.WriteStringValue(StartedOn.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(FinishedOn)) - { - writer.WritePropertyName("finishedAt"u8); - writer.WriteStringValue(FinishedOn.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(Logs)) - { - writer.WritePropertyName("logs"u8); - writer.WriteStringValue(Logs); - } - if (options.Format != "W" && Optional.IsDefined(Reason)) - { - writer.WritePropertyName("reason"u8); - writer.WriteStringValue(Reason); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterRunCommandResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterRunCommandResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterRunCommandResult(document.RootElement, options); - } - - internal static ManagedClusterRunCommandResult DeserializeManagedClusterRunCommandResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - string provisioningState = default; - int? exitCode = default; - DateTimeOffset? startedAt = default; - DateTimeOffset? finishedAt = default; - string logs = default; - string reason = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("exitCode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exitCode = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("startedAt"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - startedAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("finishedAt"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - finishedAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("logs"u8)) - { - logs = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("reason"u8)) - { - reason = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterRunCommandResult( - id, - provisioningState, - exitCode, - startedAt, - finishedAt, - logs, - reason, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterRunCommandResult)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterRunCommandResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterRunCommandResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterRunCommandResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.cs deleted file mode 100644 index c2e31dd5fc5a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandResult.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// run command result. - public partial class ManagedClusterRunCommandResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ManagedClusterRunCommandResult() - { - } - - /// Initializes a new instance of . - /// The command id. - /// provisioning State. - /// The exit code of the command. - /// The time when the command started. - /// The time when the command finished. - /// The command output. - /// An explanation of why provisioningState is set to failed (if so). - /// Keeps track of any properties unknown to the library. - internal ManagedClusterRunCommandResult(string id, string provisioningState, int? exitCode, DateTimeOffset? startedOn, DateTimeOffset? finishedOn, string logs, string reason, IDictionary serializedAdditionalRawData) - { - Id = id; - ProvisioningState = provisioningState; - ExitCode = exitCode; - StartedOn = startedOn; - FinishedOn = finishedOn; - Logs = logs; - Reason = reason; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The command id. - public string Id { get; } - /// provisioning State. - public string ProvisioningState { get; } - /// The exit code of the command. - public int? ExitCode { get; } - /// The time when the command started. - public DateTimeOffset? StartedOn { get; } - /// The time when the command finished. - public DateTimeOffset? FinishedOn { get; } - /// The command output. - public string Logs { get; } - /// An explanation of why provisioningState is set to failed (if so). - public string Reason { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs deleted file mode 100644 index 4667a6ca2f68..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.Serialization.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterSecurityProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Defender)) - { - writer.WritePropertyName("defender"u8); - writer.WriteObjectValue(Defender, options); - } - if (Optional.IsDefined(AzureKeyVaultKms)) - { - writer.WritePropertyName("azureKeyVaultKms"u8); - writer.WriteObjectValue(AzureKeyVaultKms, options); - } - if (Optional.IsDefined(WorkloadIdentity)) - { - writer.WritePropertyName("workloadIdentity"u8); - writer.WriteObjectValue(WorkloadIdentity, options); - } - if (Optional.IsDefined(ImageCleaner)) - { - writer.WritePropertyName("imageCleaner"u8); - writer.WriteObjectValue(ImageCleaner, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfile(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfile DeserializeManagedClusterSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedClusterSecurityProfileDefender defender = default; - ManagedClusterSecurityProfileKeyVaultKms azureKeyVaultKms = default; - ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity = default; - ManagedClusterSecurityProfileImageCleaner imageCleaner = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("defender"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defender = ManagedClusterSecurityProfileDefender.DeserializeManagedClusterSecurityProfileDefender(property.Value, options); - continue; - } - if (property.NameEquals("azureKeyVaultKms"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureKeyVaultKms = ManagedClusterSecurityProfileKeyVaultKms.DeserializeManagedClusterSecurityProfileKeyVaultKms(property.Value, options); - continue; - } - if (property.NameEquals("workloadIdentity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadIdentity = ManagedClusterSecurityProfileWorkloadIdentity.DeserializeManagedClusterSecurityProfileWorkloadIdentity(property.Value, options); - continue; - } - if (property.NameEquals("imageCleaner"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - imageCleaner = ManagedClusterSecurityProfileImageCleaner.DeserializeManagedClusterSecurityProfileImageCleaner(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterSecurityProfile(defender, azureKeyVaultKms, workloadIdentity, imageCleaner, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterSecurityProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs deleted file mode 100644 index 73e536655216..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfile.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Security profile for the container service cluster. - public partial class ManagedClusterSecurityProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterSecurityProfile() - { - } - - /// Initializes a new instance of . - /// Microsoft Defender settings for the security profile. - /// Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. - /// Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. - /// Image Cleaner settings for the security profile. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfile(ManagedClusterSecurityProfileDefender defender, ManagedClusterSecurityProfileKeyVaultKms azureKeyVaultKms, ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity, ManagedClusterSecurityProfileImageCleaner imageCleaner, IDictionary serializedAdditionalRawData) - { - Defender = defender; - AzureKeyVaultKms = azureKeyVaultKms; - WorkloadIdentity = workloadIdentity; - ImageCleaner = imageCleaner; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Microsoft Defender settings for the security profile. - public ManagedClusterSecurityProfileDefender Defender { get; set; } - /// Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. - public ManagedClusterSecurityProfileKeyVaultKms AzureKeyVaultKms { get; set; } - /// Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. - internal ManagedClusterSecurityProfileWorkloadIdentity WorkloadIdentity { get; set; } - /// Whether to enable workload identity. - public bool? IsWorkloadIdentityEnabled - { - get => WorkloadIdentity is null ? default : WorkloadIdentity.IsWorkloadIdentityEnabled; - set - { - if (WorkloadIdentity is null) - WorkloadIdentity = new ManagedClusterSecurityProfileWorkloadIdentity(); - WorkloadIdentity.IsWorkloadIdentityEnabled = value; - } - } - - /// Image Cleaner settings for the security profile. - public ManagedClusterSecurityProfileImageCleaner ImageCleaner { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.Serialization.cs deleted file mode 100644 index c0af7de76005..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterSecurityProfileDefender : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefender)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(LogAnalyticsWorkspaceResourceId)) - { - writer.WritePropertyName("logAnalyticsWorkspaceResourceId"u8); - writer.WriteStringValue(LogAnalyticsWorkspaceResourceId); - } - if (Optional.IsDefined(SecurityMonitoring)) - { - writer.WritePropertyName("securityMonitoring"u8); - writer.WriteObjectValue(SecurityMonitoring, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileDefender IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefender)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileDefender(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileDefender DeserializeManagedClusterSecurityProfileDefender(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier logAnalyticsWorkspaceResourceId = default; - ManagedClusterSecurityProfileDefenderSecurityMonitoring securityMonitoring = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("logAnalyticsWorkspaceResourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - logAnalyticsWorkspaceResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("securityMonitoring"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - securityMonitoring = ManagedClusterSecurityProfileDefenderSecurityMonitoring.DeserializeManagedClusterSecurityProfileDefenderSecurityMonitoring(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterSecurityProfileDefender(logAnalyticsWorkspaceResourceId, securityMonitoring, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefender)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileDefender IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterSecurityProfileDefender(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefender)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.cs deleted file mode 100644 index 6b2454c4db3f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefender.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Microsoft Defender settings for the security profile. - public partial class ManagedClusterSecurityProfileDefender - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterSecurityProfileDefender() - { - } - - /// Initializes a new instance of . - /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty. - /// Microsoft Defender threat detection for Cloud settings for the security profile. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileDefender(ResourceIdentifier logAnalyticsWorkspaceResourceId, ManagedClusterSecurityProfileDefenderSecurityMonitoring securityMonitoring, IDictionary serializedAdditionalRawData) - { - LogAnalyticsWorkspaceResourceId = logAnalyticsWorkspaceResourceId; - SecurityMonitoring = securityMonitoring; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty. - public ResourceIdentifier LogAnalyticsWorkspaceResourceId { get; set; } - /// Microsoft Defender threat detection for Cloud settings for the security profile. - internal ManagedClusterSecurityProfileDefenderSecurityMonitoring SecurityMonitoring { get; set; } - /// Whether to enable Defender threat detection. - public bool? IsSecurityMonitoringEnabled - { - get => SecurityMonitoring is null ? default : SecurityMonitoring.IsSecurityMonitoringEnabled; - set - { - if (SecurityMonitoring is null) - SecurityMonitoring = new ManagedClusterSecurityProfileDefenderSecurityMonitoring(); - SecurityMonitoring.IsSecurityMonitoringEnabled = value; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.Serialization.cs deleted file mode 100644 index e5e2e2947114..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterSecurityProfileDefenderSecurityMonitoring : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefenderSecurityMonitoring)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsSecurityMonitoringEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsSecurityMonitoringEnabled.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileDefenderSecurityMonitoring IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefenderSecurityMonitoring)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileDefenderSecurityMonitoring(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileDefenderSecurityMonitoring DeserializeManagedClusterSecurityProfileDefenderSecurityMonitoring(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterSecurityProfileDefenderSecurityMonitoring(enabled, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefenderSecurityMonitoring)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileDefenderSecurityMonitoring IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterSecurityProfileDefenderSecurityMonitoring(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileDefenderSecurityMonitoring)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs deleted file mode 100644 index 92d7c396a332..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Microsoft Defender settings for the security profile threat detection. - internal partial class ManagedClusterSecurityProfileDefenderSecurityMonitoring - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterSecurityProfileDefenderSecurityMonitoring() - { - } - - /// Initializes a new instance of . - /// Whether to enable Defender threat detection. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileDefenderSecurityMonitoring(bool? isSecurityMonitoringEnabled, IDictionary serializedAdditionalRawData) - { - IsSecurityMonitoringEnabled = isSecurityMonitoringEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable Defender threat detection. - public bool? IsSecurityMonitoringEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.Serialization.cs deleted file mode 100644 index 86962e38948f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterSecurityProfileImageCleaner : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileImageCleaner)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(IntervalHours)) - { - writer.WritePropertyName("intervalHours"u8); - writer.WriteNumberValue(IntervalHours.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileImageCleaner IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileImageCleaner)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileImageCleaner(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileImageCleaner DeserializeManagedClusterSecurityProfileImageCleaner(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? enabled = default; - int? intervalHours = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("intervalHours"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - intervalHours = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterSecurityProfileImageCleaner(enabled, intervalHours, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileImageCleaner)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileImageCleaner IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterSecurityProfileImageCleaner(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileImageCleaner)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.cs deleted file mode 100644 index 6289f9223f67..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileImageCleaner.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. Here are settings for the security profile. - public partial class ManagedClusterSecurityProfileImageCleaner - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterSecurityProfileImageCleaner() - { - } - - /// Initializes a new instance of . - /// Whether to enable Image Cleaner on AKS cluster. - /// Image Cleaner scanning interval in hours. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileImageCleaner(bool? isEnabled, int? intervalHours, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - IntervalHours = intervalHours; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable Image Cleaner on AKS cluster. - public bool? IsEnabled { get; set; } - /// Image Cleaner scanning interval in hours. - public int? IntervalHours { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.Serialization.cs deleted file mode 100644 index 51722d3ce719..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.Serialization.cs +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterSecurityProfileKeyVaultKms : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileKeyVaultKms)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(KeyId)) - { - writer.WritePropertyName("keyId"u8); - writer.WriteStringValue(KeyId); - } - if (Optional.IsDefined(KeyVaultNetworkAccess)) - { - writer.WritePropertyName("keyVaultNetworkAccess"u8); - writer.WriteStringValue(KeyVaultNetworkAccess.Value.ToString()); - } - if (Optional.IsDefined(KeyVaultResourceId)) - { - writer.WritePropertyName("keyVaultResourceId"u8); - writer.WriteStringValue(KeyVaultResourceId); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileKeyVaultKms IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileKeyVaultKms)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileKeyVaultKms(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileKeyVaultKms DeserializeManagedClusterSecurityProfileKeyVaultKms(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? enabled = default; - string keyId = default; - ManagedClusterKeyVaultNetworkAccessType? keyVaultNetworkAccess = default; - ResourceIdentifier keyVaultResourceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("keyId"u8)) - { - keyId = property.Value.GetString(); - continue; - } - if (property.NameEquals("keyVaultNetworkAccess"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - keyVaultNetworkAccess = new ManagedClusterKeyVaultNetworkAccessType(property.Value.GetString()); - continue; - } - if (property.NameEquals("keyVaultResourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - keyVaultResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterSecurityProfileKeyVaultKms(enabled, keyId, keyVaultNetworkAccess, keyVaultResourceId, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileKeyVaultKms)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileKeyVaultKms IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterSecurityProfileKeyVaultKms(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileKeyVaultKms)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.cs deleted file mode 100644 index adfa9e0437dd..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileKeyVaultKms.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Azure Key Vault key management service settings for the security profile. - public partial class ManagedClusterSecurityProfileKeyVaultKms - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterSecurityProfileKeyVaultKms() - { - } - - /// Initializes a new instance of . - /// Whether to enable Azure Key Vault key management service. The default is false. - /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. - /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`. - /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileKeyVaultKms(bool? isEnabled, string keyId, ManagedClusterKeyVaultNetworkAccessType? keyVaultNetworkAccess, ResourceIdentifier keyVaultResourceId, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - KeyId = keyId; - KeyVaultNetworkAccess = keyVaultNetworkAccess; - KeyVaultResourceId = keyVaultResourceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable Azure Key Vault key management service. The default is false. - public bool? IsEnabled { get; set; } - /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. - public string KeyId { get; set; } - /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`. - public ManagedClusterKeyVaultNetworkAccessType? KeyVaultNetworkAccess { get; set; } - /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty. - public ResourceIdentifier KeyVaultResourceId { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.Serialization.cs deleted file mode 100644 index b1e5e2276a84..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterSecurityProfileWorkloadIdentity : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileWorkloadIdentity)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsWorkloadIdentityEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsWorkloadIdentityEnabled.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterSecurityProfileWorkloadIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileWorkloadIdentity)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSecurityProfileWorkloadIdentity(document.RootElement, options); - } - - internal static ManagedClusterSecurityProfileWorkloadIdentity DeserializeManagedClusterSecurityProfileWorkloadIdentity(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterSecurityProfileWorkloadIdentity(enabled, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileWorkloadIdentity)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterSecurityProfileWorkloadIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterSecurityProfileWorkloadIdentity(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterSecurityProfileWorkloadIdentity)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.cs deleted file mode 100644 index 7a0420c72506..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSecurityProfileWorkloadIdentity.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Workload identity settings for the security profile. - internal partial class ManagedClusterSecurityProfileWorkloadIdentity - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterSecurityProfileWorkloadIdentity() - { - } - - /// Initializes a new instance of . - /// Whether to enable workload identity. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterSecurityProfileWorkloadIdentity(bool? isWorkloadIdentityEnabled, IDictionary serializedAdditionalRawData) - { - IsWorkloadIdentityEnabled = isWorkloadIdentityEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable workload identity. - public bool? IsWorkloadIdentityEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.Serialization.cs deleted file mode 100644 index 2fc9bc0a1973..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.Serialization.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterServicePrincipalProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterServicePrincipalProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId); - if (Optional.IsDefined(Secret)) - { - writer.WritePropertyName("secret"u8); - writer.WriteStringValue(Secret); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterServicePrincipalProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterServicePrincipalProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterServicePrincipalProfile(document.RootElement, options); - } - - internal static ManagedClusterServicePrincipalProfile DeserializeManagedClusterServicePrincipalProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string clientId = default; - string secret = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("clientId"u8)) - { - clientId = property.Value.GetString(); - continue; - } - if (property.NameEquals("secret"u8)) - { - secret = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterServicePrincipalProfile(clientId, secret, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterServicePrincipalProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterServicePrincipalProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterServicePrincipalProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterServicePrincipalProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuName.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuName.cs deleted file mode 100644 index 757773a3ee08..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuName.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The name of a managed cluster SKU. - public readonly partial struct ManagedClusterSkuName : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterSkuName(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string BaseValue = "Base"; - - /// Base option for the AKS control plane. - public static ManagedClusterSkuName Base { get; } = new ManagedClusterSkuName(BaseValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterSkuName left, ManagedClusterSkuName right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterSkuName left, ManagedClusterSkuName right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterSkuName(string value) => new ManagedClusterSkuName(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterSkuName other && Equals(other); - /// - public bool Equals(ManagedClusterSkuName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuTier.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuTier.cs deleted file mode 100644 index e9af0b127c6f..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSkuTier.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details. - public readonly partial struct ManagedClusterSkuTier : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedClusterSkuTier(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PremiumValue = "Premium"; - private const string StandardValue = "Standard"; - private const string FreeValue = "Free"; - - /// Cluster has premium capabilities in addition to all of the capabilities included in 'Standard'. Premium enables selection of LongTermSupport (aka.ms/aks/lts) for certain Kubernetes versions. - public static ManagedClusterSkuTier Premium { get; } = new ManagedClusterSkuTier(PremiumValue); - /// Recommended for mission-critical and production workloads. Includes Kubernetes control plane autoscaling, workload-intensive testing, and up to 5,000 nodes per cluster. Guarantees 99.95% availability of the Kubernetes API server endpoint for clusters that use Availability Zones and 99.9% of availability for clusters that don't use Availability Zones. - public static ManagedClusterSkuTier Standard { get; } = new ManagedClusterSkuTier(StandardValue); - /// The cluster management is free, but charged for VM, storage, and networking usage. Best for experimenting, learning, simple testing, or workloads with fewer than 10 nodes. Not recommended for production use cases. - public static ManagedClusterSkuTier Free { get; } = new ManagedClusterSkuTier(FreeValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedClusterSkuTier left, ManagedClusterSkuTier right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedClusterSkuTier left, ManagedClusterSkuTier right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedClusterSkuTier(string value) => new ManagedClusterSkuTier(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedClusterSkuTier other && Equals(other); - /// - public bool Equals(ManagedClusterSkuTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.Serialization.cs deleted file mode 100644 index 9e7ac51fd4a2..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.Serialization.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterStorageProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(DiskCsiDriver)) - { - writer.WritePropertyName("diskCSIDriver"u8); - writer.WriteObjectValue(DiskCsiDriver, options); - } - if (Optional.IsDefined(FileCsiDriver)) - { - writer.WritePropertyName("fileCSIDriver"u8); - writer.WriteObjectValue(FileCsiDriver, options); - } - if (Optional.IsDefined(SnapshotController)) - { - writer.WritePropertyName("snapshotController"u8); - writer.WriteObjectValue(SnapshotController, options); - } - if (Optional.IsDefined(BlobCsiDriver)) - { - writer.WritePropertyName("blobCSIDriver"u8); - writer.WriteObjectValue(BlobCsiDriver, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterStorageProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfile(document.RootElement, options); - } - - internal static ManagedClusterStorageProfile DeserializeManagedClusterStorageProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedClusterStorageProfileDiskCsiDriver diskCsiDriver = default; - ManagedClusterStorageProfileFileCsiDriver fileCsiDriver = default; - ManagedClusterStorageProfileSnapshotController snapshotController = default; - ManagedClusterStorageProfileBlobCsiDriver blobCsiDriver = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("diskCSIDriver"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diskCsiDriver = ManagedClusterStorageProfileDiskCsiDriver.DeserializeManagedClusterStorageProfileDiskCsiDriver(property.Value, options); - continue; - } - if (property.NameEquals("fileCSIDriver"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fileCsiDriver = ManagedClusterStorageProfileFileCsiDriver.DeserializeManagedClusterStorageProfileFileCsiDriver(property.Value, options); - continue; - } - if (property.NameEquals("snapshotController"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - snapshotController = ManagedClusterStorageProfileSnapshotController.DeserializeManagedClusterStorageProfileSnapshotController(property.Value, options); - continue; - } - if (property.NameEquals("blobCSIDriver"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - blobCsiDriver = ManagedClusterStorageProfileBlobCsiDriver.DeserializeManagedClusterStorageProfileBlobCsiDriver(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterStorageProfile(diskCsiDriver, fileCsiDriver, snapshotController, blobCsiDriver, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterStorageProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterStorageProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.cs deleted file mode 100644 index ea5c58a09885..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfile.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Storage profile for the container service cluster. - public partial class ManagedClusterStorageProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterStorageProfile() - { - } - - /// Initializes a new instance of . - /// AzureDisk CSI Driver settings for the storage profile. - /// AzureFile CSI Driver settings for the storage profile. - /// Snapshot Controller settings for the storage profile. - /// AzureBlob CSI Driver settings for the storage profile. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfile(ManagedClusterStorageProfileDiskCsiDriver diskCsiDriver, ManagedClusterStorageProfileFileCsiDriver fileCsiDriver, ManagedClusterStorageProfileSnapshotController snapshotController, ManagedClusterStorageProfileBlobCsiDriver blobCsiDriver, IDictionary serializedAdditionalRawData) - { - DiskCsiDriver = diskCsiDriver; - FileCsiDriver = fileCsiDriver; - SnapshotController = snapshotController; - BlobCsiDriver = blobCsiDriver; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// AzureDisk CSI Driver settings for the storage profile. - internal ManagedClusterStorageProfileDiskCsiDriver DiskCsiDriver { get; set; } - - /// AzureFile CSI Driver settings for the storage profile. - internal ManagedClusterStorageProfileFileCsiDriver FileCsiDriver { get; set; } - - /// Snapshot Controller settings for the storage profile. - internal ManagedClusterStorageProfileSnapshotController SnapshotController { get; set; } - - /// AzureBlob CSI Driver settings for the storage profile. - internal ManagedClusterStorageProfileBlobCsiDriver BlobCsiDriver { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.cs deleted file mode 100644 index 32fecc32abdc..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// AzureBlob CSI Driver settings for the storage profile. - internal partial class ManagedClusterStorageProfileBlobCsiDriver - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterStorageProfileBlobCsiDriver() - { - } - - /// Initializes a new instance of . - /// Whether to enable AzureBlob CSI Driver. The default value is false. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfileBlobCsiDriver(bool? isEnabled, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable AzureBlob CSI Driver. The default value is false. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.Serialization.cs deleted file mode 100644 index ccb85cf7d025..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterStorageProfileDiskCsiDriver : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileDiskCsiDriver)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterStorageProfileDiskCsiDriver IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileDiskCsiDriver)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfileDiskCsiDriver(document.RootElement, options); - } - - internal static ManagedClusterStorageProfileDiskCsiDriver DeserializeManagedClusterStorageProfileDiskCsiDriver(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterStorageProfileDiskCsiDriver(enabled, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileDiskCsiDriver)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterStorageProfileDiskCsiDriver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterStorageProfileDiskCsiDriver(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileDiskCsiDriver)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.cs deleted file mode 100644 index aa5d5f1db274..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileDiskCsiDriver.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// AzureDisk CSI Driver settings for the storage profile. - internal partial class ManagedClusterStorageProfileDiskCsiDriver - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterStorageProfileDiskCsiDriver() - { - } - - /// Initializes a new instance of . - /// Whether to enable AzureDisk CSI Driver. The default value is true. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfileDiskCsiDriver(bool? isEnabled, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable AzureDisk CSI Driver. The default value is true. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.Serialization.cs deleted file mode 100644 index 9e584b8509a0..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterStorageProfileFileCsiDriver : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileFileCsiDriver)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterStorageProfileFileCsiDriver IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileFileCsiDriver)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfileFileCsiDriver(document.RootElement, options); - } - - internal static ManagedClusterStorageProfileFileCsiDriver DeserializeManagedClusterStorageProfileFileCsiDriver(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterStorageProfileFileCsiDriver(enabled, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileFileCsiDriver)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterStorageProfileFileCsiDriver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterStorageProfileFileCsiDriver(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileFileCsiDriver)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.cs deleted file mode 100644 index a289a4e1957b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileFileCsiDriver.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// AzureFile CSI Driver settings for the storage profile. - internal partial class ManagedClusterStorageProfileFileCsiDriver - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterStorageProfileFileCsiDriver() - { - } - - /// Initializes a new instance of . - /// Whether to enable AzureFile CSI Driver. The default value is true. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfileFileCsiDriver(bool? isEnabled, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Whether to enable AzureFile CSI Driver. The default value is true. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.Serialization.cs deleted file mode 100644 index 271488dc79d8..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterStorageProfileSnapshotController : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileSnapshotController)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterStorageProfileSnapshotController IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileSnapshotController)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfileSnapshotController(document.RootElement, options); - } - - internal static ManagedClusterStorageProfileSnapshotController DeserializeManagedClusterStorageProfileSnapshotController(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterStorageProfileSnapshotController(enabled, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileSnapshotController)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterStorageProfileSnapshotController IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterStorageProfileSnapshotController(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileSnapshotController)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.Serialization.cs index 2b90e851dfdb..906a3197079a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileBlobCsiDriver.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.Serialization.cs @@ -13,23 +13,25 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class ManagedClusterStorageProfileBlobCsiDriver : IUtf8JsonSerializable, IJsonModel + public partial class ManagedClusterUpdate : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileBlobCsiDriver)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) + writer.WritePropertyName("upgrade"u8); + writer.WriteObjectValue(Upgrade, options); + if (Optional.IsDefined(NodeImageSelection)) { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); + writer.WritePropertyName("nodeImageSelection"u8); + writer.WriteObjectValue(NodeImageSelection, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -49,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteEndObject(); } - ManagedClusterStorageProfileBlobCsiDriver IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ManagedClusterUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileBlobCsiDriver)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterStorageProfileBlobCsiDriver(document.RootElement, options); + return DeserializeManagedClusterUpdate(document.RootElement, options); } - internal static ManagedClusterStorageProfileBlobCsiDriver DeserializeManagedClusterStorageProfileBlobCsiDriver(JsonElement element, ModelReaderWriterOptions options = null) + internal static ManagedClusterUpdate DeserializeManagedClusterUpdate(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,18 +71,24 @@ internal static ManagedClusterStorageProfileBlobCsiDriver DeserializeManagedClus { return null; } - bool? enabled = default; + ManagedClusterUpgradeSpec upgrade = default; + NodeImageSelection nodeImageSelection = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("enabled"u8)) + if (property.NameEquals("upgrade"u8)) + { + upgrade = ManagedClusterUpgradeSpec.DeserializeManagedClusterUpgradeSpec(property.Value, options); + continue; + } + if (property.NameEquals("nodeImageSelection"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - enabled = property.Value.GetBoolean(); + nodeImageSelection = NodeImageSelection.DeserializeNodeImageSelection(property.Value, options); continue; } if (options.Format != "W") @@ -89,38 +97,38 @@ internal static ManagedClusterStorageProfileBlobCsiDriver DeserializeManagedClus } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterStorageProfileBlobCsiDriver(enabled, serializedAdditionalRawData); + return new ManagedClusterUpdate(upgrade, nodeImageSelection, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileBlobCsiDriver)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support writing '{options.Format}' format."); } } - ManagedClusterStorageProfileBlobCsiDriver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ManagedClusterUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterStorageProfileBlobCsiDriver(document.RootElement, options); + return DeserializeManagedClusterUpdate(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterStorageProfileBlobCsiDriver)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpdate)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.cs index 5124b3b90287..5ccf1256be4d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterRunCommandContent.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpdate.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// A run command request. - public partial class ManagedClusterRunCommandContent + /// The update to be applied to the ManagedClusters. + public partial class ManagedClusterUpdate { /// /// Keeps track of any properties unknown to the library. @@ -45,39 +45,44 @@ public partial class ManagedClusterRunCommandContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The command to run. - /// is null. - public ManagedClusterRunCommandContent(string command) + /// Initializes a new instance of . + /// The upgrade to apply to the ManagedClusters. + /// is null. + public ManagedClusterUpdate(ManagedClusterUpgradeSpec upgrade) { - Argument.AssertNotNull(command, nameof(command)); + Argument.AssertNotNull(upgrade, nameof(upgrade)); - Command = command; + Upgrade = upgrade; } - /// Initializes a new instance of . - /// The command to run. - /// A base64 encoded zip file containing the files required by the command. - /// AuthToken issued for AKS AAD Server App. + /// Initializes a new instance of . + /// The upgrade to apply to the ManagedClusters. + /// The node image upgrade to be applied to the target nodes in update run. /// Keeps track of any properties unknown to the library. - internal ManagedClusterRunCommandContent(string command, string context, string clusterToken, IDictionary serializedAdditionalRawData) + internal ManagedClusterUpdate(ManagedClusterUpgradeSpec upgrade, NodeImageSelection nodeImageSelection, IDictionary serializedAdditionalRawData) { - Command = command; - Context = context; - ClusterToken = clusterToken; + Upgrade = upgrade; + NodeImageSelection = nodeImageSelection; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ManagedClusterRunCommandContent() + /// Initializes a new instance of for deserialization. + internal ManagedClusterUpdate() { } - /// The command to run. - public string Command { get; } - /// A base64 encoded zip file containing the files required by the command. - public string Context { get; set; } - /// AuthToken issued for AKS AAD Server App. - public string ClusterToken { get; set; } + /// The upgrade to apply to the ManagedClusters. + public ManagedClusterUpgradeSpec Upgrade { get; set; } + /// The node image upgrade to be applied to the target nodes in update run. + internal NodeImageSelection NodeImageSelection { get; set; } + /// The node image upgrade type. + public NodeImageSelectionType? SelectionType + { + get => NodeImageSelection is null ? default(NodeImageSelectionType?) : NodeImageSelection.SelectionType; + set + { + NodeImageSelection = value.HasValue ? new NodeImageSelection(value.Value) : null; + } + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs index 9d40474d9a03..5a5dc1f72f70 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioCertificateAuthority.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.Serialization.cs @@ -13,23 +13,25 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class IstioCertificateAuthority : IUtf8JsonSerializable, IJsonModel + public partial class ManagedClusterUpgradeSpec : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioCertificateAuthority)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Plugin)) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(UpgradeType.ToString()); + if (Optional.IsDefined(KubernetesVersion)) { - writer.WritePropertyName("plugin"u8); - writer.WriteObjectValue(Plugin, options); + writer.WritePropertyName("kubernetesVersion"u8); + writer.WriteStringValue(KubernetesVersion); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -49,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } - IstioCertificateAuthority IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ManagedClusterUpgradeSpec IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioCertificateAuthority)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioCertificateAuthority(document.RootElement, options); + return DeserializeManagedClusterUpgradeSpec(document.RootElement, options); } - internal static IstioCertificateAuthority DeserializeIstioCertificateAuthority(JsonElement element, ModelReaderWriterOptions options = null) + internal static ManagedClusterUpgradeSpec DeserializeManagedClusterUpgradeSpec(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,18 +71,20 @@ internal static IstioCertificateAuthority DeserializeIstioCertificateAuthority(J { return null; } - IstioPluginCertificateAuthority plugin = default; + ManagedClusterUpgradeType type = default; + string kubernetesVersion = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("plugin"u8)) + if (property.NameEquals("type"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - plugin = IstioPluginCertificateAuthority.DeserializeIstioPluginCertificateAuthority(property.Value, options); + type = new ManagedClusterUpgradeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("kubernetesVersion"u8)) + { + kubernetesVersion = property.Value.GetString(); continue; } if (options.Format != "W") @@ -89,38 +93,38 @@ internal static IstioCertificateAuthority DeserializeIstioCertificateAuthority(J } } serializedAdditionalRawData = rawDataDictionary; - return new IstioCertificateAuthority(plugin, serializedAdditionalRawData); + return new ManagedClusterUpgradeSpec(type, kubernetesVersion, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(IstioCertificateAuthority)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support writing '{options.Format}' format."); } } - IstioCertificateAuthority IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ManagedClusterUpgradeSpec IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIstioCertificateAuthority(document.RootElement, options); + return DeserializeManagedClusterUpgradeSpec(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IstioCertificateAuthority)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedClusterUpgradeSpec)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.cs index 28aef628adcc..7243279689bb 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPoolUpgradeProfileUpgradesItem.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeSpec.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// The ManagedClusterPoolUpgradeProfileUpgradesItem. - public partial class ManagedClusterPoolUpgradeProfileUpgradesItem + /// The upgrade to apply to a ManagedCluster. + public partial class ManagedClusterUpgradeSpec { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,32 @@ public partial class ManagedClusterPoolUpgradeProfileUpgradesItem /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ManagedClusterPoolUpgradeProfileUpgradesItem() + /// Initializes a new instance of . + /// ManagedClusterUpgradeType is the type of upgrade to be applied. + public ManagedClusterUpgradeSpec(ManagedClusterUpgradeType upgradeType) { + UpgradeType = upgradeType; } - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// Whether the Kubernetes version is currently in preview. + /// Initializes a new instance of . + /// ManagedClusterUpgradeType is the type of upgrade to be applied. + /// The Kubernetes version to upgrade the member clusters to. /// Keeps track of any properties unknown to the library. - internal ManagedClusterPoolUpgradeProfileUpgradesItem(string kubernetesVersion, bool? isPreview, IDictionary serializedAdditionalRawData) + internal ManagedClusterUpgradeSpec(ManagedClusterUpgradeType upgradeType, string kubernetesVersion, IDictionary serializedAdditionalRawData) { + UpgradeType = upgradeType; KubernetesVersion = kubernetesVersion; - IsPreview = isPreview; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The Kubernetes version (major.minor.patch). - public string KubernetesVersion { get; } - /// Whether the Kubernetes version is currently in preview. - public bool? IsPreview { get; } + /// Initializes a new instance of for deserialization. + internal ManagedClusterUpgradeSpec() + { + } + + /// ManagedClusterUpgradeType is the type of upgrade to be applied. + public ManagedClusterUpgradeType UpgradeType { get; set; } + /// The Kubernetes version to upgrade the member clusters to. + public string KubernetesVersion { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeType.cs new file mode 100644 index 000000000000..a2e241b6a80b --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterUpgradeType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The type of upgrade to perform when targeting ManagedClusters. + public readonly partial struct ManagedClusterUpgradeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedClusterUpgradeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FullValue = "Full"; + private const string NodeImageOnlyValue = "NodeImageOnly"; + private const string ControlPlaneOnlyValue = "ControlPlaneOnly"; + + /// Full upgrades the control plane and all agent pools of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set. + public static ManagedClusterUpgradeType Full { get; } = new ManagedClusterUpgradeType(FullValue); + /// NodeImageOnly upgrades only the node images of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to NOT be set. + public static ManagedClusterUpgradeType NodeImageOnly { get; } = new ManagedClusterUpgradeType(NodeImageOnlyValue); + /// ControlPlaneOnly upgrades only targets the KubernetesVersion of the ManagedClusters and will not be applied to the AgentPool. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set. + public static ManagedClusterUpgradeType ControlPlaneOnly { get; } = new ManagedClusterUpgradeType(ControlPlaneOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedClusterUpgradeType left, ManagedClusterUpgradeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedClusterUpgradeType left, ManagedClusterUpgradeType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedClusterUpgradeType(string value) => new ManagedClusterUpgradeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedClusterUpgradeType other && Equals(other); + /// + public bool Equals(ManagedClusterUpgradeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.Serialization.cs deleted file mode 100644 index 7b6d97fc5f19..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class ManagedClusterVerticalPodAutoscaler : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterVerticalPodAutoscaler)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsVpaEnabled); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterVerticalPodAutoscaler IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterVerticalPodAutoscaler)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterVerticalPodAutoscaler(document.RootElement, options); - } - - internal static ManagedClusterVerticalPodAutoscaler DeserializeManagedClusterVerticalPodAutoscaler(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool enabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - enabled = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterVerticalPodAutoscaler(enabled, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterVerticalPodAutoscaler)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterVerticalPodAutoscaler IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterVerticalPodAutoscaler(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterVerticalPodAutoscaler)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.cs deleted file mode 100644 index 38b46b181b1e..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterVerticalPodAutoscaler.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. - internal partial class ManagedClusterVerticalPodAutoscaler - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Whether to enable VPA. Default value is false. - public ManagedClusterVerticalPodAutoscaler(bool isVpaEnabled) - { - IsVpaEnabled = isVpaEnabled; - } - - /// Initializes a new instance of . - /// Whether to enable VPA. Default value is false. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterVerticalPodAutoscaler(bool isVpaEnabled, IDictionary serializedAdditionalRawData) - { - IsVpaEnabled = isVpaEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterVerticalPodAutoscaler() - { - } - - /// Whether to enable VPA. Default value is false. - public bool IsVpaEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.Serialization.cs deleted file mode 100644 index 37327639ea59..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.Serialization.cs +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterWindowsProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterWindowsProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("adminUsername"u8); - writer.WriteStringValue(AdminUsername); - if (Optional.IsDefined(AdminPassword)) - { - writer.WritePropertyName("adminPassword"u8); - writer.WriteStringValue(AdminPassword); - } - if (Optional.IsDefined(LicenseType)) - { - writer.WritePropertyName("licenseType"u8); - writer.WriteStringValue(LicenseType.Value.ToString()); - } - if (Optional.IsDefined(IsCsiProxyEnabled)) - { - writer.WritePropertyName("enableCSIProxy"u8); - writer.WriteBooleanValue(IsCsiProxyEnabled.Value); - } - if (Optional.IsDefined(GmsaProfile)) - { - writer.WritePropertyName("gmsaProfile"u8); - writer.WriteObjectValue(GmsaProfile, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterWindowsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterWindowsProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterWindowsProfile(document.RootElement, options); - } - - internal static ManagedClusterWindowsProfile DeserializeManagedClusterWindowsProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string adminUsername = default; - string adminPassword = default; - WindowsVmLicenseType? licenseType = default; - bool? enableCsiProxy = default; - WindowsGmsaProfile gmsaProfile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("adminUsername"u8)) - { - adminUsername = property.Value.GetString(); - continue; - } - if (property.NameEquals("adminPassword"u8)) - { - adminPassword = property.Value.GetString(); - continue; - } - if (property.NameEquals("licenseType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - licenseType = new WindowsVmLicenseType(property.Value.GetString()); - continue; - } - if (property.NameEquals("enableCSIProxy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableCsiProxy = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("gmsaProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gmsaProfile = WindowsGmsaProfile.DeserializeWindowsGmsaProfile(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterWindowsProfile( - adminUsername, - adminPassword, - licenseType, - enableCsiProxy, - gmsaProfile, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterWindowsProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterWindowsProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterWindowsProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterWindowsProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs deleted file mode 100644 index 55b0e0102071..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWindowsProfile.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Profile for Windows VMs in the managed cluster. - public partial class ManagedClusterWindowsProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Specifies the name of the administrator account. <br><br> **Restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character <br><br> **Max-length:** 20 characters. - /// is null. - public ManagedClusterWindowsProfile(string adminUsername) - { - Argument.AssertNotNull(adminUsername, nameof(adminUsername)); - - AdminUsername = adminUsername; - } - - /// Initializes a new instance of . - /// Specifies the name of the administrator account. <br><br> **Restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character <br><br> **Max-length:** 20 characters. - /// Specifies the password of the administrator account. <br><br> **Minimum-length:** 8 characters <br><br> **Max-length:** 123 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. - /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). - /// The Windows gMSA Profile in the Managed Cluster. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterWindowsProfile(string adminUsername, string adminPassword, WindowsVmLicenseType? licenseType, bool? isCsiProxyEnabled, WindowsGmsaProfile gmsaProfile, IDictionary serializedAdditionalRawData) - { - AdminUsername = adminUsername; - AdminPassword = adminPassword; - LicenseType = licenseType; - IsCsiProxyEnabled = isCsiProxyEnabled; - GmsaProfile = gmsaProfile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterWindowsProfile() - { - } - - /// Specifies the name of the administrator account. <br><br> **Restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character <br><br> **Max-length:** 20 characters. - public string AdminUsername { get; set; } - /// Specifies the password of the administrator account. <br><br> **Minimum-length:** 8 characters <br><br> **Max-length:** 123 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - public string AdminPassword { get; set; } - /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. - public WindowsVmLicenseType? LicenseType { get; set; } - /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). - public bool? IsCsiProxyEnabled { get; set; } - /// The Windows gMSA Profile in the Managed Cluster. - public WindowsGmsaProfile GmsaProfile { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.Serialization.cs deleted file mode 100644 index 742155b8f538..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class ManagedClusterWorkloadAutoScalerProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Keda)) - { - writer.WritePropertyName("keda"u8); - writer.WriteObjectValue(Keda, options); - } - if (Optional.IsDefined(VerticalPodAutoscaler)) - { - writer.WritePropertyName("verticalPodAutoscaler"u8); - writer.WriteObjectValue(VerticalPodAutoscaler, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ManagedClusterWorkloadAutoScalerProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterWorkloadAutoScalerProfile(document.RootElement, options); - } - - internal static ManagedClusterWorkloadAutoScalerProfile DeserializeManagedClusterWorkloadAutoScalerProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedClusterWorkloadAutoScalerProfileKeda keda = default; - ManagedClusterVerticalPodAutoscaler verticalPodAutoscaler = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keda"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - keda = ManagedClusterWorkloadAutoScalerProfileKeda.DeserializeManagedClusterWorkloadAutoScalerProfileKeda(property.Value, options); - continue; - } - if (property.NameEquals("verticalPodAutoscaler"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - verticalPodAutoscaler = ManagedClusterVerticalPodAutoscaler.DeserializeManagedClusterVerticalPodAutoscaler(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterWorkloadAutoScalerProfile(keda, verticalPodAutoscaler, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfile)} does not support writing '{options.Format}' format."); - } - } - - ManagedClusterWorkloadAutoScalerProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterWorkloadAutoScalerProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.cs deleted file mode 100644 index abd845aa4af4..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfile.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Workload Auto-scaler profile for the managed cluster. - public partial class ManagedClusterWorkloadAutoScalerProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedClusterWorkloadAutoScalerProfile() - { - } - - /// Initializes a new instance of . - /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. - /// VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterWorkloadAutoScalerProfile(ManagedClusterWorkloadAutoScalerProfileKeda keda, ManagedClusterVerticalPodAutoscaler verticalPodAutoscaler, IDictionary serializedAdditionalRawData) - { - Keda = keda; - VerticalPodAutoscaler = verticalPodAutoscaler; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. - internal ManagedClusterWorkloadAutoScalerProfileKeda Keda { get; set; } - /// Whether to enable KEDA. - public bool? IsKedaEnabled - { - get => Keda is null ? default(bool?) : Keda.IsKedaEnabled; - set - { - Keda = value.HasValue ? new ManagedClusterWorkloadAutoScalerProfileKeda(value.Value) : null; - } - } - - /// VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. - internal ManagedClusterVerticalPodAutoscaler VerticalPodAutoscaler { get; set; } - /// Whether to enable VPA. Default value is false. - public bool? IsVpaEnabled - { - get => VerticalPodAutoscaler is null ? default(bool?) : VerticalPodAutoscaler.IsVpaEnabled; - set - { - VerticalPodAutoscaler = value.HasValue ? new ManagedClusterVerticalPodAutoscaler(value.Value) : null; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.cs deleted file mode 100644 index e4580a03834e..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. - internal partial class ManagedClusterWorkloadAutoScalerProfileKeda - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Whether to enable KEDA. - public ManagedClusterWorkloadAutoScalerProfileKeda(bool isKedaEnabled) - { - IsKedaEnabled = isKedaEnabled; - } - - /// Initializes a new instance of . - /// Whether to enable KEDA. - /// Keeps track of any properties unknown to the library. - internal ManagedClusterWorkloadAutoScalerProfileKeda(bool isKedaEnabled, IDictionary serializedAdditionalRawData) - { - IsKedaEnabled = isKedaEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedClusterWorkloadAutoScalerProfileKeda() - { - } - - /// Whether to enable KEDA. - public bool IsKedaEnabled { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs similarity index 51% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs index 14885f3cd5bb..dd8ae30dfc29 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterDelegatedIdentity.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.Serialization.cs @@ -10,41 +10,45 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ContainerService.Models { - public partial class ManagedClusterDelegatedIdentity : IUtf8JsonSerializable, IJsonModel + internal partial class ManagedServiceIdentity : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterDelegatedIdentity)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ResourceId)) + if (options.Format != "W" && Optional.IsDefined(PrincipalId)) { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); } - if (Optional.IsDefined(TenantId)) + if (options.Format != "W" && Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); writer.WriteStringValue(TenantId.Value); } - if (Optional.IsDefined(ReferralResource)) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(IdentityType.ToString()); + if (Optional.IsCollectionDefined(UserAssignedIdentities)) { - writer.WritePropertyName("referralResource"u8); - writer.WriteStringValue(ReferralResource); - } - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, item.Value); + } + writer.WriteEndObject(); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -64,19 +68,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteEndObject(); } - ManagedClusterDelegatedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ManagedServiceIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterDelegatedIdentity)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterDelegatedIdentity(document.RootElement, options); + return DeserializeManagedServiceIdentity(document.RootElement, options); } - internal static ManagedClusterDelegatedIdentity DeserializeManagedClusterDelegatedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + internal static ManagedServiceIdentity DeserializeManagedServiceIdentity(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -84,21 +88,21 @@ internal static ManagedClusterDelegatedIdentity DeserializeManagedClusterDelegat { return null; } - ResourceIdentifier resourceId = default; + Guid? principalId = default; Guid? tenantId = default; - string referralResource = default; - AzureLocation? location = default; + ManagedServiceIdentityType type = default; + IDictionary userAssignedIdentities = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resourceId"u8)) + if (property.NameEquals("principalId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceId = new ResourceIdentifier(property.Value.GetString()); + principalId = property.Value.GetGuid(); continue; } if (property.NameEquals("tenantId"u8)) @@ -110,18 +114,23 @@ internal static ManagedClusterDelegatedIdentity DeserializeManagedClusterDelegat tenantId = property.Value.GetGuid(); continue; } - if (property.NameEquals("referralResource"u8)) + if (property.NameEquals("type"u8)) { - referralResource = property.Value.GetString(); + type = new ManagedServiceIdentityType(property.Value.GetString()); continue; } - if (property.NameEquals("location"u8)) + if (property.NameEquals("userAssignedIdentities"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - location = new AzureLocation(property.Value.GetString()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); + } + userAssignedIdentities = dictionary; continue; } if (options.Format != "W") @@ -130,38 +139,38 @@ internal static ManagedClusterDelegatedIdentity DeserializeManagedClusterDelegat } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterDelegatedIdentity(resourceId, tenantId, referralResource, location, serializedAdditionalRawData); + return new ManagedServiceIdentity(principalId, tenantId, type, userAssignedIdentities ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ManagedClusterDelegatedIdentity)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support writing '{options.Format}' format."); } } - ManagedClusterDelegatedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ManagedServiceIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterDelegatedIdentity(document.RootElement, options); + return DeserializeManagedServiceIdentity(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterDelegatedIdentity)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedServiceIdentity)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.cs new file mode 100644 index 000000000000..b090197251eb --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentity.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Managed service identity (system assigned and/or user assigned identities). + internal partial class ManagedServiceIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public ManagedServiceIdentity(ManagedServiceIdentityType identityType) + { + IdentityType = identityType; + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + /// Keeps track of any properties unknown to the library. + internal ManagedServiceIdentity(Guid? principalId, Guid? tenantId, ManagedServiceIdentityType identityType, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + PrincipalId = principalId; + TenantId = tenantId; + IdentityType = identityType; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ManagedServiceIdentity() + { + } + + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + public Guid? PrincipalId { get; } + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + public Guid? TenantId { get; } + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public ManagedServiceIdentityType IdentityType { get; set; } + /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 000000000000..6562b2d6353d --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedServiceIdentityType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public readonly partial struct ManagedServiceIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedServiceIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string SystemAssignedValue = "SystemAssigned"; + private const string UserAssignedValue = "UserAssigned"; + private const string SystemAssignedUserAssignedValue = "SystemAssigned, UserAssigned"; + + /// None. + public static ManagedServiceIdentityType None { get; } = new ManagedServiceIdentityType(NoneValue); + /// SystemAssigned. + public static ManagedServiceIdentityType SystemAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedValue); + /// UserAssigned. + public static ManagedServiceIdentityType UserAssigned { get; } = new ManagedServiceIdentityType(UserAssignedValue); + /// SystemAssigned, UserAssigned. + public static ManagedServiceIdentityType SystemAssignedUserAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedUserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedServiceIdentityType(string value) => new ManagedServiceIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedServiceIdentityType other && Equals(other); + /// + public bool Equals(ManagedServiceIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.Serialization.cs similarity index 53% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.Serialization.cs index 030c6ec32be2..147b86ce818e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.Serialization.cs @@ -10,48 +10,46 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; -namespace Azure.ResourceManager.ContainerService +namespace Azure.ResourceManager.ContainerService.Models { - public partial class MeshUpgradeProfileData : IUtf8JsonSerializable, IJsonModel + public partial class MemberUpdateStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshUpgradeProfileData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") + if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (options.Format != "W") + if (options.Format != "W" && Optional.IsDefined(ClusterResourceId)) + { + writer.WritePropertyName("clusterResourceId"u8); + writer.WriteStringValue(ClusterResourceId); + } + if (options.Format != "W" && Optional.IsDefined(OperationId)) { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); + writer.WritePropertyName("operationId"u8); + writer.WriteStringValue(OperationId); } - if (options.Format != "W" && Optional.IsDefined(SystemData)) + if (options.Format != "W" && Optional.IsDefined(Message)) { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -71,19 +69,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteEndObject(); } - MeshUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MemberUpdateStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshUpgradeProfileData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshUpgradeProfileData(document.RootElement, options); + return DeserializeMemberUpdateStatus(document.RootElement, options); } - internal static MeshUpgradeProfileData DeserializeMeshUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null) + internal static MemberUpdateStatus DeserializeMemberUpdateStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,27 +89,22 @@ internal static MeshUpgradeProfileData DeserializeMeshUpgradeProfileData(JsonEle { return null; } - MeshUpgradeProfileProperties properties = default; - ResourceIdentifier id = default; + UpdateStatus status = default; string name = default; - ResourceType type = default; - SystemData systemData = default; + ResourceIdentifier clusterResourceId = default; + string operationId = default; + string message = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = MeshUpgradeProfileProperties.DeserializeMeshUpgradeProfileProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); continue; } if (property.NameEquals("name"u8)) @@ -119,18 +112,23 @@ internal static MeshUpgradeProfileData DeserializeMeshUpgradeProfileData(JsonEle name = property.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) + if (property.NameEquals("clusterResourceId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + clusterResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("operationId"u8)) + { + operationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); continue; } if (options.Format != "W") @@ -139,44 +137,44 @@ internal static MeshUpgradeProfileData DeserializeMeshUpgradeProfileData(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new MeshUpgradeProfileData( - id, + return new MemberUpdateStatus( + status, name, - type, - systemData, - properties, + clusterResourceId, + operationId, + message, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MeshUpgradeProfileData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support writing '{options.Format}' format."); } } - MeshUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MemberUpdateStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshUpgradeProfileData(document.RootElement, options); + return DeserializeMemberUpdateStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MeshUpgradeProfileData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MemberUpdateStatus)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.cs similarity index 53% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.cs index 2cc8ba9f2867..578cdd70e245 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MemberUpdateStatus.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - /// The SKU of a Managed Cluster. - public partial class ManagedClusterSku + /// The status of a member update operation. + public partial class MemberUpdateStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +46,37 @@ public partial class ManagedClusterSku /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ManagedClusterSku() + /// Initializes a new instance of . + internal MemberUpdateStatus() { } - /// Initializes a new instance of . - /// The name of a managed cluster SKU. - /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details. + /// Initializes a new instance of . + /// The status of the MemberUpdate operation. + /// The name of the FleetMember. + /// The Azure resource id of the target Kubernetes cluster. + /// The operation resource id of the latest attempt to perform the operation. + /// The status message after processing the member update operation. /// Keeps track of any properties unknown to the library. - internal ManagedClusterSku(ManagedClusterSkuName? name, ManagedClusterSkuTier? tier, IDictionary serializedAdditionalRawData) + internal MemberUpdateStatus(UpdateStatus status, string name, ResourceIdentifier clusterResourceId, string operationId, string message, IDictionary serializedAdditionalRawData) { + Status = status; Name = name; - Tier = tier; + ClusterResourceId = clusterResourceId; + OperationId = operationId; + Message = message; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The name of a managed cluster SKU. - public ManagedClusterSkuName? Name { get; set; } - /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details. - public ManagedClusterSkuTier? Tier { get; set; } + /// The status of the MemberUpdate operation. + public UpdateStatus Status { get; } + /// The name of the FleetMember. + public string Name { get; } + /// The Azure resource id of the target Kubernetes cluster. + public ResourceIdentifier ClusterResourceId { get; } + /// The operation resource id of the latest attempt to perform the operation. + public string OperationId { get; } + /// The status message after processing the member update operation. + public string Message { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.cs deleted file mode 100644 index 28ac06c5c522..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Holds information on upgrades and compatibility for given major.minor mesh release. - public partial class MeshRevision - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public MeshRevision() - { - Upgrades = new ChangeTrackingList(); - CompatibleWith = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The revision of the mesh release. - /// List of revisions available for upgrade of a specific mesh revision. - /// List of items this revision of service mesh is compatible with, and their associated versions. - /// Keeps track of any properties unknown to the library. - internal MeshRevision(string revision, IList upgrades, IList compatibleWith, IDictionary serializedAdditionalRawData) - { - Revision = revision; - Upgrades = upgrades; - CompatibleWith = compatibleWith; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The revision of the mesh release. - public string Revision { get; set; } - /// List of revisions available for upgrade of a specific mesh revision. - public IList Upgrades { get; } - /// List of items this revision of service mesh is compatible with, and their associated versions. - public IList CompatibleWith { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.Serialization.cs deleted file mode 100644 index a2da4f6658ff..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class MeshRevisionProfileList : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MeshRevisionProfileList)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MeshRevisionProfileList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MeshRevisionProfileList)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshRevisionProfileList(document.RootElement, options); - } - - internal static MeshRevisionProfileList DeserializeMeshRevisionProfileList(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MeshRevisionProfileData.DeserializeMeshRevisionProfileData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MeshRevisionProfileList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MeshRevisionProfileList)} does not support writing '{options.Format}' format."); - } - } - - MeshRevisionProfileList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshRevisionProfileList(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MeshRevisionProfileList)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.cs deleted file mode 100644 index 09ec75f4ad1a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileList.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Holds an array of MeshRevisionsProfiles. - internal partial class MeshRevisionProfileList - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal MeshRevisionProfileList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Array of service mesh add-on revision profiles for all supported mesh modes. - /// The URL to get the next set of mesh revision profile. - /// Keeps track of any properties unknown to the library. - internal MeshRevisionProfileList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Array of service mesh add-on revision profiles for all supported mesh modes. - public IReadOnlyList Value { get; } - /// The URL to get the next set of mesh revision profile. - public string NextLink { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.Serialization.cs deleted file mode 100644 index c0e69d54240d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevisionProfileProperties.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class MeshRevisionProfileProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MeshRevisionProfileProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(MeshRevisions)) - { - writer.WritePropertyName("meshRevisions"u8); - writer.WriteStartArray(); - foreach (var item in MeshRevisions) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MeshRevisionProfileProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MeshRevisionProfileProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshRevisionProfileProperties(document.RootElement, options); - } - - internal static MeshRevisionProfileProperties DeserializeMeshRevisionProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList meshRevisions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("meshRevisions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MeshRevision.DeserializeMeshRevision(item, options)); - } - meshRevisions = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MeshRevisionProfileProperties(meshRevisions ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MeshRevisionProfileProperties)} does not support writing '{options.Format}' format."); - } - } - - MeshRevisionProfileProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshRevisionProfileProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MeshRevisionProfileProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.Serialization.cs deleted file mode 100644 index 5e6d25730cfb..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.Serialization.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class MeshUpgradeProfileProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MeshUpgradeProfileProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Revision)) - { - writer.WritePropertyName("revision"u8); - writer.WriteStringValue(Revision); - } - if (Optional.IsCollectionDefined(Upgrades)) - { - writer.WritePropertyName("upgrades"u8); - writer.WriteStartArray(); - foreach (var item in Upgrades) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(CompatibleWith)) - { - writer.WritePropertyName("compatibleWith"u8); - writer.WriteStartArray(); - foreach (var item in CompatibleWith) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MeshUpgradeProfileProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MeshUpgradeProfileProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshUpgradeProfileProperties(document.RootElement, options); - } - - internal static MeshUpgradeProfileProperties DeserializeMeshUpgradeProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string revision = default; - IList upgrades = default; - IList compatibleWith = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("revision"u8)) - { - revision = property.Value.GetString(); - continue; - } - if (property.NameEquals("upgrades"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - upgrades = array; - continue; - } - if (property.NameEquals("compatibleWith"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CompatibleVersions.DeserializeCompatibleVersions(item, options)); - } - compatibleWith = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MeshUpgradeProfileProperties(revision, upgrades ?? new ChangeTrackingList(), compatibleWith ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MeshUpgradeProfileProperties)} does not support writing '{options.Format}' format."); - } - } - - MeshUpgradeProfileProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshUpgradeProfileProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MeshUpgradeProfileProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.cs deleted file mode 100644 index ad3f86c995ea..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshUpgradeProfileProperties.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Mesh upgrade profile properties for a major.minor release. - public partial class MeshUpgradeProfileProperties : MeshRevision - { - /// Initializes a new instance of . - public MeshUpgradeProfileProperties() - { - } - - /// Initializes a new instance of . - /// The revision of the mesh release. - /// List of revisions available for upgrade of a specific mesh revision. - /// List of items this revision of service mesh is compatible with, and their associated versions. - /// Keeps track of any properties unknown to the library. - internal MeshUpgradeProfileProperties(string revision, IList upgrades, IList compatibleWith, IDictionary serializedAdditionalRawData) : base(revision, upgrades, compatibleWith, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NetworkDataplane.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NetworkDataplane.cs deleted file mode 100644 index eafe875b4024..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NetworkDataplane.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Network dataplane used in the Kubernetes cluster. - public readonly partial struct NetworkDataplane : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public NetworkDataplane(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureValue = "azure"; - private const string CiliumValue = "cilium"; - - /// Use Azure network dataplane. - public static NetworkDataplane Azure { get; } = new NetworkDataplane(AzureValue); - /// Use Cilium network dataplane. See [Azure CNI Powered by Cilium](https://learn.microsoft.com/azure/aks/azure-cni-powered-by-cilium) for more information. - public static NetworkDataplane Cilium { get; } = new NetworkDataplane(CiliumValue); - /// Determines if two values are the same. - public static bool operator ==(NetworkDataplane left, NetworkDataplane right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(NetworkDataplane left, NetworkDataplane right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator NetworkDataplane(string value) => new NetworkDataplane(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is NetworkDataplane other && Equals(other); - /// - public bool Equals(NetworkDataplane other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.Serialization.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.Serialization.cs index 3cf27693a46f..14a027f39cb9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.Serialization.cs @@ -13,26 +13,21 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ServiceMeshProfile : IUtf8JsonSerializable, IJsonModel + internal partial class NodeImageSelection : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ServiceMeshProfile)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.ToString()); - if (Optional.IsDefined(Istio)) - { - writer.WritePropertyName("istio"u8); - writer.WriteObjectValue(Istio, options); - } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SelectionType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -51,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - ServiceMeshProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NodeImageSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ServiceMeshProfile)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeServiceMeshProfile(document.RootElement, options); + return DeserializeNodeImageSelection(document.RootElement, options); } - internal static ServiceMeshProfile DeserializeServiceMeshProfile(JsonElement element, ModelReaderWriterOptions options = null) + internal static NodeImageSelection DeserializeNodeImageSelection(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,24 +66,14 @@ internal static ServiceMeshProfile DeserializeServiceMeshProfile(JsonElement ele { return null; } - ServiceMeshMode mode = default; - IstioServiceMesh istio = default; + NodeImageSelectionType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mode"u8)) + if (property.NameEquals("type"u8)) { - mode = new ServiceMeshMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("istio"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - istio = IstioServiceMesh.DeserializeIstioServiceMesh(property.Value, options); + type = new NodeImageSelectionType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -97,38 +82,38 @@ internal static ServiceMeshProfile DeserializeServiceMeshProfile(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new ServiceMeshProfile(mode, istio, serializedAdditionalRawData); + return new NodeImageSelection(type, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ServiceMeshProfile)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support writing '{options.Format}' format."); } } - ServiceMeshProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NodeImageSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeServiceMeshProfile(document.RootElement, options); + return DeserializeNodeImageSelection(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ServiceMeshProfile)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelection)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.cs similarity index 63% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.cs index 42010667cb2e..85e29432ba88 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelection.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// For schedules like: 'recur every day' or 'recur every 3 days'. - internal partial class DailySchedule + /// The node image upgrade to be applied to the target nodes in update run. + internal partial class NodeImageSelection { /// /// Keeps track of any properties unknown to the library. @@ -45,28 +45,28 @@ internal partial class DailySchedule /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Specifies the number of days between each set of occurrences. - public DailySchedule(int intervalDays) + /// Initializes a new instance of . + /// The node image upgrade type. + public NodeImageSelection(NodeImageSelectionType selectionType) { - IntervalDays = intervalDays; + SelectionType = selectionType; } - /// Initializes a new instance of . - /// Specifies the number of days between each set of occurrences. + /// Initializes a new instance of . + /// The node image upgrade type. /// Keeps track of any properties unknown to the library. - internal DailySchedule(int intervalDays, IDictionary serializedAdditionalRawData) + internal NodeImageSelection(NodeImageSelectionType selectionType, IDictionary serializedAdditionalRawData) { - IntervalDays = intervalDays; + SelectionType = selectionType; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DailySchedule() + /// Initializes a new instance of for deserialization. + internal NodeImageSelection() { } - /// Specifies the number of days between each set of occurrences. - public int IntervalDays { get; set; } + /// The node image upgrade type. + public NodeImageSelectionType SelectionType { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs index 8c73333b4a17..cc9bb0ad42ae 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.Serialization.cs @@ -13,28 +13,28 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceTimeSpan : IUtf8JsonSerializable, IJsonModel + internal partial class NodeImageSelectionStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTimeSpan)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(StartOn)) + if (options.Format != "W" && Optional.IsCollectionDefined(SelectedNodeImageVersions)) { - writer.WritePropertyName("start"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - if (Optional.IsDefined(EndOn)) - { - writer.WritePropertyName("end"u8); - writer.WriteStringValue(EndOn.Value, "O"); + writer.WritePropertyName("selectedNodeImageVersions"u8); + writer.WriteStartArray(); + foreach (var item in SelectedNodeImageVersions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteEndObject(); } - ContainerServiceTimeSpan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NodeImageSelectionStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTimeSpan)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTimeSpan(document.RootElement, options); + return DeserializeNodeImageSelectionStatus(document.RootElement, options); } - internal static ContainerServiceTimeSpan DeserializeContainerServiceTimeSpan(JsonElement element, ModelReaderWriterOptions options = null) + internal static NodeImageSelectionStatus DeserializeNodeImageSelectionStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -74,28 +74,23 @@ internal static ContainerServiceTimeSpan DeserializeContainerServiceTimeSpan(Jso { return null; } - DateTimeOffset? start = default; - DateTimeOffset? end = default; + IReadOnlyList selectedNodeImageVersions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("start"u8)) + if (property.NameEquals("selectedNodeImageVersions"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - start = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("end"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(NodeImageVersion.DeserializeNodeImageVersion(item, options)); } - end = property.Value.GetDateTimeOffset("O"); + selectedNodeImageVersions = array; continue; } if (options.Format != "W") @@ -104,38 +99,38 @@ internal static ContainerServiceTimeSpan DeserializeContainerServiceTimeSpan(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceTimeSpan(start, end, serializedAdditionalRawData); + return new NodeImageSelectionStatus(selectedNodeImageVersions ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceTimeSpan)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support writing '{options.Format}' format."); } } - ContainerServiceTimeSpan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NodeImageSelectionStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTimeSpan(document.RootElement, options); + return DeserializeNodeImageSelectionStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTimeSpan)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageSelectionStatus)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.cs similarity index 66% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.cs index 94ac4e777bf8..96fb7d8234d2 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersionListResult.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionStatus.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Hold values properties, which is array of KubernetesVersion. - public partial class KubernetesVersionListResult + /// The node image upgrade specs for the update run. + internal partial class NodeImageSelectionStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,22 @@ public partial class KubernetesVersionListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal KubernetesVersionListResult() + /// Initializes a new instance of . + internal NodeImageSelectionStatus() { - Values = new ChangeTrackingList(); + SelectedNodeImageVersions = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Array of AKS supported Kubernetes versions. + /// Initializes a new instance of . + /// The image versions to upgrade the nodes to. /// Keeps track of any properties unknown to the library. - internal KubernetesVersionListResult(IReadOnlyList values, IDictionary serializedAdditionalRawData) + internal NodeImageSelectionStatus(IReadOnlyList selectedNodeImageVersions, IDictionary serializedAdditionalRawData) { - Values = values; + SelectedNodeImageVersions = selectedNodeImageVersions; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Array of AKS supported Kubernetes versions. - public IReadOnlyList Values { get; } + /// The image versions to upgrade the nodes to. + public IReadOnlyList SelectedNodeImageVersions { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionType.cs new file mode 100644 index 000000000000..8c7f11d9b0ba --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageSelectionType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The node image upgrade type. + public readonly partial struct NodeImageSelectionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NodeImageSelectionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LatestValue = "Latest"; + private const string ConsistentValue = "Consistent"; + + /// Use the latest image version when upgrading nodes. Clusters may use different image versions (e.g., 'AKSUbuntu-1804gen2containerd-2021.10.12' and 'AKSUbuntu-1804gen2containerd-2021.10.19') because, for example, the latest available version is different in different regions. + public static NodeImageSelectionType Latest { get; } = new NodeImageSelectionType(LatestValue); + /// The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. + public static NodeImageSelectionType Consistent { get; } = new NodeImageSelectionType(ConsistentValue); + /// Determines if two values are the same. + public static bool operator ==(NodeImageSelectionType left, NodeImageSelectionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NodeImageSelectionType left, NodeImageSelectionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator NodeImageSelectionType(string value) => new NodeImageSelectionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NodeImageSelectionType other && Equals(other); + /// + public bool Equals(NodeImageSelectionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.Serialization.cs index 3b74d2d5acd5..3302d830a324 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshPublicKey.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceSshPublicKey : IUtf8JsonSerializable, IJsonModel + public partial class NodeImageVersion : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceSshPublicKey)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("keyData"u8); - writer.WriteStringValue(KeyData); + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - ContainerServiceSshPublicKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NodeImageVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceSshPublicKey)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceSshPublicKey(document.RootElement, options); + return DeserializeNodeImageVersion(document.RootElement, options); } - internal static ContainerServiceSshPublicKey DeserializeContainerServiceSshPublicKey(JsonElement element, ModelReaderWriterOptions options = null) + internal static NodeImageVersion DeserializeNodeImageVersion(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,14 @@ internal static ContainerServiceSshPublicKey DeserializeContainerServiceSshPubli { return null; } - string keyData = default; + string version = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("keyData"u8)) + if (property.NameEquals("version"u8)) { - keyData = property.Value.GetString(); + version = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +85,38 @@ internal static ContainerServiceSshPublicKey DeserializeContainerServiceSshPubli } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceSshPublicKey(keyData, serializedAdditionalRawData); + return new NodeImageVersion(version, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceSshPublicKey)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support writing '{options.Format}' format."); } } - ContainerServiceSshPublicKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NodeImageVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceSshPublicKey(document.RootElement, options); + return DeserializeNodeImageVersion(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceSshPublicKey)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NodeImageVersion)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.cs similarity index 70% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.cs index c2330fe6effd..e005209fba38 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/NodeImageVersion.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Describes the Power State of the cluster. - internal partial class ContainerServicePowerState + /// The node upgrade image version. + public partial class NodeImageVersion { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,21 @@ internal partial class ContainerServicePowerState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ContainerServicePowerState() + /// Initializes a new instance of . + internal NodeImageVersion() { } - /// Initializes a new instance of . - /// Tells whether the cluster is Running or Stopped. + /// Initializes a new instance of . + /// The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). /// Keeps track of any properties unknown to the library. - internal ContainerServicePowerState(ContainerServiceStateCode? code, IDictionary serializedAdditionalRawData) + internal NodeImageVersion(string version, IDictionary serializedAdditionalRawData) { - Code = code; + Version = version; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Tells whether the cluster is Running or Stopped. - public ContainerServiceStateCode? Code { get; set; } + /// The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). + public string Version { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleDownMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleDownMode.cs deleted file mode 100644 index d105f3136370..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleDownMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Describes how VMs are added to or removed from Agent Pools. See [billing states](https://docs.microsoft.com/azure/virtual-machines/states-billing). - public readonly partial struct ScaleDownMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScaleDownMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DeleteValue = "Delete"; - private const string DeallocateValue = "Deallocate"; - - /// Create new instances during scale up and remove instances during scale down. - public static ScaleDownMode Delete { get; } = new ScaleDownMode(DeleteValue); - /// Attempt to start deallocated instances (if they exist) during scale up and deallocate instances during scale down. - public static ScaleDownMode Deallocate { get; } = new ScaleDownMode(DeallocateValue); - /// Determines if two values are the same. - public static bool operator ==(ScaleDownMode left, ScaleDownMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScaleDownMode left, ScaleDownMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ScaleDownMode(string value) => new ScaleDownMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScaleDownMode other && Equals(other); - /// - public bool Equals(ScaleDownMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs deleted file mode 100644 index af1824cdbcbc..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction see [spot VMs](https://docs.microsoft.com/azure/virtual-machines/spot-vms). - public readonly partial struct ScaleSetEvictionPolicy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScaleSetEvictionPolicy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DeleteValue = "Delete"; - private const string DeallocateValue = "Deallocate"; - - /// Nodes in the underlying Scale Set of the node pool are deleted when they're evicted. - public static ScaleSetEvictionPolicy Delete { get; } = new ScaleSetEvictionPolicy(DeleteValue); - /// Nodes in the underlying Scale Set of the node pool are set to the stopped-deallocated state upon eviction. Nodes in the stopped-deallocated state count against your compute quota and can cause issues with cluster scaling or upgrading. - public static ScaleSetEvictionPolicy Deallocate { get; } = new ScaleSetEvictionPolicy(DeallocateValue); - /// Determines if two values are the same. - public static bool operator ==(ScaleSetEvictionPolicy left, ScaleSetEvictionPolicy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScaleSetEvictionPolicy left, ScaleSetEvictionPolicy right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ScaleSetEvictionPolicy(string value) => new ScaleSetEvictionPolicy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScaleSetEvictionPolicy other && Equals(other); - /// - public bool Equals(ScaleSetEvictionPolicy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetPriority.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetPriority.cs deleted file mode 100644 index 503dd66b55d9..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ScaleSetPriority.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The Virtual Machine Scale Set priority. - public readonly partial struct ScaleSetPriority : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScaleSetPriority(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SpotValue = "Spot"; - private const string RegularValue = "Regular"; - - /// Spot priority VMs will be used. There is no SLA for spot nodes. See [spot on AKS](https://docs.microsoft.com/azure/aks/spot-node-pool) for more information. - public static ScaleSetPriority Spot { get; } = new ScaleSetPriority(SpotValue); - /// Regular VMs will be used. - public static ScaleSetPriority Regular { get; } = new ScaleSetPriority(RegularValue); - /// Determines if two values are the same. - public static bool operator ==(ScaleSetPriority left, ScaleSetPriority right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScaleSetPriority left, ScaleSetPriority right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ScaleSetPriority(string value) => new ScaleSetPriority(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScaleSetPriority other && Equals(other); - /// - public bool Equals(ScaleSetPriority other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshMode.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshMode.cs deleted file mode 100644 index c9a76d1efed5..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Mode of the service mesh. - public readonly partial struct ServiceMeshMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ServiceMeshMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IstioValue = "Istio"; - private const string DisabledValue = "Disabled"; - - /// Istio deployed as an AKS addon. - public static ServiceMeshMode Istio { get; } = new ServiceMeshMode(IstioValue); - /// Mesh is disabled. - public static ServiceMeshMode Disabled { get; } = new ServiceMeshMode(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(ServiceMeshMode left, ServiceMeshMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ServiceMeshMode left, ServiceMeshMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ServiceMeshMode(string value) => new ServiceMeshMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ServiceMeshMode other && Equals(other); - /// - public bool Equals(ServiceMeshMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.Serialization.cs index ef731ed0ad8d..5ba168052ba4 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePowerState.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.Serialization.cs @@ -13,24 +13,26 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class ContainerServicePowerState : IUtf8JsonSerializable, IJsonModel + public partial class SkipProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServicePowerState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SkipProperties)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + writer.WritePropertyName("targets"u8); + writer.WriteStartArray(); + foreach (var item in Targets) { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.Value.ToString()); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -49,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - ContainerServicePowerState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SkipProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServicePowerState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SkipProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServicePowerState(document.RootElement, options); + return DeserializeSkipProperties(document.RootElement, options); } - internal static ContainerServicePowerState DeserializeContainerServicePowerState(JsonElement element, ModelReaderWriterOptions options = null) + internal static SkipProperties DeserializeSkipProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,18 +71,19 @@ internal static ContainerServicePowerState DeserializeContainerServicePowerState { return null; } - ContainerServiceStateCode? code = default; + IList targets = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (property.NameEquals("targets"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(SkipTarget.DeserializeSkipTarget(item, options)); } - code = new ContainerServiceStateCode(property.Value.GetString()); + targets = array; continue; } if (options.Format != "W") @@ -89,38 +92,38 @@ internal static ContainerServicePowerState DeserializeContainerServicePowerState } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServicePowerState(code, serializedAdditionalRawData); + return new SkipProperties(targets, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServicePowerState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SkipProperties)} does not support writing '{options.Format}' format."); } } - ContainerServicePowerState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SkipProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServicePowerState(document.RootElement, options); + return DeserializeSkipProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServicePowerState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SkipProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.cs similarity index 67% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.cs index da84bda223c6..139ae8d8062a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ServiceMeshProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipProperties.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ContainerService.Models { - /// Service mesh profile for a managed cluster. - public partial class ServiceMeshProfile + /// The properties of a skip operation containing multiple skip requests. + public partial class SkipProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,32 +46,31 @@ public partial class ServiceMeshProfile /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Mode of the service mesh. - public ServiceMeshProfile(ServiceMeshMode mode) + /// Initializes a new instance of . + /// The targets to skip. + /// is null. + public SkipProperties(IEnumerable targets) { - Mode = mode; + Argument.AssertNotNull(targets, nameof(targets)); + + Targets = targets.ToList(); } - /// Initializes a new instance of . - /// Mode of the service mesh. - /// Istio service mesh configuration. + /// Initializes a new instance of . + /// The targets to skip. /// Keeps track of any properties unknown to the library. - internal ServiceMeshProfile(ServiceMeshMode mode, IstioServiceMesh istio, IDictionary serializedAdditionalRawData) + internal SkipProperties(IList targets, IDictionary serializedAdditionalRawData) { - Mode = mode; - Istio = istio; + Targets = targets; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ServiceMeshProfile() + /// Initializes a new instance of for deserialization. + internal SkipProperties() { } - /// Mode of the service mesh. - public ServiceMeshMode Mode { get; set; } - /// Istio service mesh configuration. - public IstioServiceMesh Istio { get; set; } + /// The targets to skip. + public IList Targets { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.Serialization.cs new file mode 100644 index 000000000000..88ac1c97b487 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class SkipTarget : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipTarget)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TargetType.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SkipTarget IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipTarget)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSkipTarget(document.RootElement, options); + } + + internal static SkipTarget DeserializeSkipTarget(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TargetType type = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new TargetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SkipTarget(type, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SkipTarget)} does not support writing '{options.Format}' format."); + } + } + + SkipTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSkipTarget(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SkipTarget)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.cs new file mode 100644 index 000000000000..ef41905d6dc5 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SkipTarget.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The definition of a single skip request. + public partial class SkipTarget + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The skip target type. + /// + /// The skip target's name. + /// To skip a member/group/stage, use the member/group/stage's name; + /// Tp skip an after stage wait, use the parent stage's name. + /// + /// is null. + public SkipTarget(TargetType targetType, string name) + { + Argument.AssertNotNull(name, nameof(name)); + + TargetType = targetType; + Name = name; + } + + /// Initializes a new instance of . + /// The skip target type. + /// + /// The skip target's name. + /// To skip a member/group/stage, use the member/group/stage's name; + /// Tp skip an after stage wait, use the parent stage's name. + /// + /// Keeps track of any properties unknown to the library. + internal SkipTarget(TargetType targetType, string name, IDictionary serializedAdditionalRawData) + { + TargetType = targetType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SkipTarget() + { + } + + /// The skip target type. + public TargetType TargetType { get; } + /// + /// The skip target's name. + /// To skip a member/group/stage, use the member/group/stage's name; + /// Tp skip an after stage wait, use the parent stage's name. + /// + public string Name { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SnapshotType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SnapshotType.cs deleted file mode 100644 index 8dfff240354e..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SnapshotType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The type of a snapshot. The default is NodePool. - public readonly partial struct SnapshotType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SnapshotType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NodePoolValue = "NodePool"; - - /// The snapshot is a snapshot of a node pool. - public static SnapshotType NodePool { get; } = new SnapshotType(NodePoolValue); - /// Determines if two values are the same. - public static bool operator ==(SnapshotType left, SnapshotType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SnapshotType left, SnapshotType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SnapshotType(string value) => new SnapshotType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SnapshotType other && Equals(other); - /// - public bool Equals(SnapshotType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.Serialization.cs deleted file mode 100644 index e7edcd45ad4b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.Serialization.cs +++ /dev/null @@ -1,556 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - public partial class SysctlConfig : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SysctlConfig)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(NetCoreSomaxconn)) - { - writer.WritePropertyName("netCoreSomaxconn"u8); - writer.WriteNumberValue(NetCoreSomaxconn.Value); - } - if (Optional.IsDefined(NetCoreNetdevMaxBacklog)) - { - writer.WritePropertyName("netCoreNetdevMaxBacklog"u8); - writer.WriteNumberValue(NetCoreNetdevMaxBacklog.Value); - } - if (Optional.IsDefined(NetCoreRmemDefault)) - { - writer.WritePropertyName("netCoreRmemDefault"u8); - writer.WriteNumberValue(NetCoreRmemDefault.Value); - } - if (Optional.IsDefined(NetCoreRmemMax)) - { - writer.WritePropertyName("netCoreRmemMax"u8); - writer.WriteNumberValue(NetCoreRmemMax.Value); - } - if (Optional.IsDefined(NetCoreWmemDefault)) - { - writer.WritePropertyName("netCoreWmemDefault"u8); - writer.WriteNumberValue(NetCoreWmemDefault.Value); - } - if (Optional.IsDefined(NetCoreWmemMax)) - { - writer.WritePropertyName("netCoreWmemMax"u8); - writer.WriteNumberValue(NetCoreWmemMax.Value); - } - if (Optional.IsDefined(NetCoreOptmemMax)) - { - writer.WritePropertyName("netCoreOptmemMax"u8); - writer.WriteNumberValue(NetCoreOptmemMax.Value); - } - if (Optional.IsDefined(NetIPv4TcpMaxSynBacklog)) - { - writer.WritePropertyName("netIpv4TcpMaxSynBacklog"u8); - writer.WriteNumberValue(NetIPv4TcpMaxSynBacklog.Value); - } - if (Optional.IsDefined(NetIPv4TcpMaxTwBuckets)) - { - writer.WritePropertyName("netIpv4TcpMaxTwBuckets"u8); - writer.WriteNumberValue(NetIPv4TcpMaxTwBuckets.Value); - } - if (Optional.IsDefined(NetIPv4TcpFinTimeout)) - { - writer.WritePropertyName("netIpv4TcpFinTimeout"u8); - writer.WriteNumberValue(NetIPv4TcpFinTimeout.Value); - } - if (Optional.IsDefined(NetIPv4TcpKeepaliveTime)) - { - writer.WritePropertyName("netIpv4TcpKeepaliveTime"u8); - writer.WriteNumberValue(NetIPv4TcpKeepaliveTime.Value); - } - if (Optional.IsDefined(NetIPv4TcpKeepaliveProbes)) - { - writer.WritePropertyName("netIpv4TcpKeepaliveProbes"u8); - writer.WriteNumberValue(NetIPv4TcpKeepaliveProbes.Value); - } - if (Optional.IsDefined(NetIPv4TcpKeepaliveIntvl)) - { - writer.WritePropertyName("netIpv4TcpkeepaliveIntvl"u8); - writer.WriteNumberValue(NetIPv4TcpKeepaliveIntvl.Value); - } - if (Optional.IsDefined(NetIPv4TcpTwReuse)) - { - writer.WritePropertyName("netIpv4TcpTwReuse"u8); - writer.WriteBooleanValue(NetIPv4TcpTwReuse.Value); - } - if (Optional.IsDefined(NetIPv4IPLocalPortRange)) - { - writer.WritePropertyName("netIpv4IpLocalPortRange"u8); - writer.WriteStringValue(NetIPv4IPLocalPortRange); - } - if (Optional.IsDefined(NetIPv4NeighDefaultGcThresh1)) - { - writer.WritePropertyName("netIpv4NeighDefaultGcThresh1"u8); - writer.WriteNumberValue(NetIPv4NeighDefaultGcThresh1.Value); - } - if (Optional.IsDefined(NetIPv4NeighDefaultGcThresh2)) - { - writer.WritePropertyName("netIpv4NeighDefaultGcThresh2"u8); - writer.WriteNumberValue(NetIPv4NeighDefaultGcThresh2.Value); - } - if (Optional.IsDefined(NetIPv4NeighDefaultGcThresh3)) - { - writer.WritePropertyName("netIpv4NeighDefaultGcThresh3"u8); - writer.WriteNumberValue(NetIPv4NeighDefaultGcThresh3.Value); - } - if (Optional.IsDefined(NetNetfilterNfConntrackMax)) - { - writer.WritePropertyName("netNetfilterNfConntrackMax"u8); - writer.WriteNumberValue(NetNetfilterNfConntrackMax.Value); - } - if (Optional.IsDefined(NetNetfilterNfConntrackBuckets)) - { - writer.WritePropertyName("netNetfilterNfConntrackBuckets"u8); - writer.WriteNumberValue(NetNetfilterNfConntrackBuckets.Value); - } - if (Optional.IsDefined(FsInotifyMaxUserWatches)) - { - writer.WritePropertyName("fsInotifyMaxUserWatches"u8); - writer.WriteNumberValue(FsInotifyMaxUserWatches.Value); - } - if (Optional.IsDefined(FsFileMax)) - { - writer.WritePropertyName("fsFileMax"u8); - writer.WriteNumberValue(FsFileMax.Value); - } - if (Optional.IsDefined(FsAioMaxNr)) - { - writer.WritePropertyName("fsAioMaxNr"u8); - writer.WriteNumberValue(FsAioMaxNr.Value); - } - if (Optional.IsDefined(FsNrOpen)) - { - writer.WritePropertyName("fsNrOpen"u8); - writer.WriteNumberValue(FsNrOpen.Value); - } - if (Optional.IsDefined(KernelThreadsMax)) - { - writer.WritePropertyName("kernelThreadsMax"u8); - writer.WriteNumberValue(KernelThreadsMax.Value); - } - if (Optional.IsDefined(VmMaxMapCount)) - { - writer.WritePropertyName("vmMaxMapCount"u8); - writer.WriteNumberValue(VmMaxMapCount.Value); - } - if (Optional.IsDefined(VmSwappiness)) - { - writer.WritePropertyName("vmSwappiness"u8); - writer.WriteNumberValue(VmSwappiness.Value); - } - if (Optional.IsDefined(VmVfsCachePressure)) - { - writer.WritePropertyName("vmVfsCachePressure"u8); - writer.WriteNumberValue(VmVfsCachePressure.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - SysctlConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SysctlConfig)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSysctlConfig(document.RootElement, options); - } - - internal static SysctlConfig DeserializeSysctlConfig(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? netCoreSomaxconn = default; - int? netCoreNetdevMaxBacklog = default; - int? netCoreRmemDefault = default; - int? netCoreRmemMax = default; - int? netCoreWmemDefault = default; - int? netCoreWmemMax = default; - int? netCoreOptmemMax = default; - int? netIPv4TcpMaxSynBacklog = default; - int? netIPv4TcpMaxTwBuckets = default; - int? netIPv4TcpFinTimeout = default; - int? netIPv4TcpKeepaliveTime = default; - int? netIPv4TcpKeepaliveProbes = default; - int? netIPv4TcpKeepaliveIntvl = default; - bool? netIPv4TcpTwReuse = default; - string netIPv4IPLocalPortRange = default; - int? netIPv4NeighDefaultGcThresh1 = default; - int? netIPv4NeighDefaultGcThresh2 = default; - int? netIPv4NeighDefaultGcThresh3 = default; - int? netNetfilterNfConntrackMax = default; - int? netNetfilterNfConntrackBuckets = default; - int? fsInotifyMaxUserWatches = default; - int? fsFileMax = default; - int? fsAioMaxNr = default; - int? fsNrOpen = default; - int? kernelThreadsMax = default; - int? vmMaxMapCount = default; - int? vmSwappiness = default; - int? vmVfsCachePressure = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("netCoreSomaxconn"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreSomaxconn = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreNetdevMaxBacklog"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreNetdevMaxBacklog = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreRmemDefault"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreRmemDefault = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreRmemMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreRmemMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreWmemDefault"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreWmemDefault = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreWmemMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreWmemMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netCoreOptmemMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netCoreOptmemMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpMaxSynBacklog"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpMaxSynBacklog = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpMaxTwBuckets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpMaxTwBuckets = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpFinTimeout"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpFinTimeout = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpKeepaliveTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpKeepaliveTime = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpKeepaliveProbes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpKeepaliveProbes = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpkeepaliveIntvl"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpKeepaliveIntvl = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4TcpTwReuse"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4TcpTwReuse = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("netIpv4IpLocalPortRange"u8)) - { - netIPv4IPLocalPortRange = property.Value.GetString(); - continue; - } - if (property.NameEquals("netIpv4NeighDefaultGcThresh1"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4NeighDefaultGcThresh1 = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4NeighDefaultGcThresh2"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4NeighDefaultGcThresh2 = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netIpv4NeighDefaultGcThresh3"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netIPv4NeighDefaultGcThresh3 = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netNetfilterNfConntrackMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netNetfilterNfConntrackMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("netNetfilterNfConntrackBuckets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - netNetfilterNfConntrackBuckets = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("fsInotifyMaxUserWatches"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fsInotifyMaxUserWatches = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("fsFileMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fsFileMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("fsAioMaxNr"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fsAioMaxNr = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("fsNrOpen"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fsNrOpen = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("kernelThreadsMax"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kernelThreadsMax = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmMaxMapCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vmMaxMapCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmSwappiness"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vmSwappiness = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("vmVfsCachePressure"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vmVfsCachePressure = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SysctlConfig( - netCoreSomaxconn, - netCoreNetdevMaxBacklog, - netCoreRmemDefault, - netCoreRmemMax, - netCoreWmemDefault, - netCoreWmemMax, - netCoreOptmemMax, - netIPv4TcpMaxSynBacklog, - netIPv4TcpMaxTwBuckets, - netIPv4TcpFinTimeout, - netIPv4TcpKeepaliveTime, - netIPv4TcpKeepaliveProbes, - netIPv4TcpKeepaliveIntvl, - netIPv4TcpTwReuse, - netIPv4IPLocalPortRange, - netIPv4NeighDefaultGcThresh1, - netIPv4NeighDefaultGcThresh2, - netIPv4NeighDefaultGcThresh3, - netNetfilterNfConntrackMax, - netNetfilterNfConntrackBuckets, - fsInotifyMaxUserWatches, - fsFileMax, - fsAioMaxNr, - fsNrOpen, - kernelThreadsMax, - vmMaxMapCount, - vmSwappiness, - vmVfsCachePressure, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(SysctlConfig)} does not support writing '{options.Format}' format."); - } - } - - SysctlConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSysctlConfig(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SysctlConfig)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.cs deleted file mode 100644 index 6301dd66813b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/SysctlConfig.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Sysctl settings for Linux agent nodes. - public partial class SysctlConfig - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public SysctlConfig() - { - } - - /// Initializes a new instance of . - /// Sysctl setting net.core.somaxconn. - /// Sysctl setting net.core.netdev_max_backlog. - /// Sysctl setting net.core.rmem_default. - /// Sysctl setting net.core.rmem_max. - /// Sysctl setting net.core.wmem_default. - /// Sysctl setting net.core.wmem_max. - /// Sysctl setting net.core.optmem_max. - /// Sysctl setting net.ipv4.tcp_max_syn_backlog. - /// Sysctl setting net.ipv4.tcp_max_tw_buckets. - /// Sysctl setting net.ipv4.tcp_fin_timeout. - /// Sysctl setting net.ipv4.tcp_keepalive_time. - /// Sysctl setting net.ipv4.tcp_keepalive_probes. - /// Sysctl setting net.ipv4.tcp_keepalive_intvl. - /// Sysctl setting net.ipv4.tcp_tw_reuse. - /// Sysctl setting net.ipv4.ip_local_port_range. - /// Sysctl setting net.ipv4.neigh.default.gc_thresh1. - /// Sysctl setting net.ipv4.neigh.default.gc_thresh2. - /// Sysctl setting net.ipv4.neigh.default.gc_thresh3. - /// Sysctl setting net.netfilter.nf_conntrack_max. - /// Sysctl setting net.netfilter.nf_conntrack_buckets. - /// Sysctl setting fs.inotify.max_user_watches. - /// Sysctl setting fs.file-max. - /// Sysctl setting fs.aio-max-nr. - /// Sysctl setting fs.nr_open. - /// Sysctl setting kernel.threads-max. - /// Sysctl setting vm.max_map_count. - /// Sysctl setting vm.swappiness. - /// Sysctl setting vm.vfs_cache_pressure. - /// Keeps track of any properties unknown to the library. - internal SysctlConfig(int? netCoreSomaxconn, int? netCoreNetdevMaxBacklog, int? netCoreRmemDefault, int? netCoreRmemMax, int? netCoreWmemDefault, int? netCoreWmemMax, int? netCoreOptmemMax, int? netIPv4TcpMaxSynBacklog, int? netIPv4TcpMaxTwBuckets, int? netIPv4TcpFinTimeout, int? netIPv4TcpKeepaliveTime, int? netIPv4TcpKeepaliveProbes, int? netIPv4TcpKeepaliveIntvl, bool? netIPv4TcpTwReuse, string netIPv4IPLocalPortRange, int? netIPv4NeighDefaultGcThresh1, int? netIPv4NeighDefaultGcThresh2, int? netIPv4NeighDefaultGcThresh3, int? netNetfilterNfConntrackMax, int? netNetfilterNfConntrackBuckets, int? fsInotifyMaxUserWatches, int? fsFileMax, int? fsAioMaxNr, int? fsNrOpen, int? kernelThreadsMax, int? vmMaxMapCount, int? vmSwappiness, int? vmVfsCachePressure, IDictionary serializedAdditionalRawData) - { - NetCoreSomaxconn = netCoreSomaxconn; - NetCoreNetdevMaxBacklog = netCoreNetdevMaxBacklog; - NetCoreRmemDefault = netCoreRmemDefault; - NetCoreRmemMax = netCoreRmemMax; - NetCoreWmemDefault = netCoreWmemDefault; - NetCoreWmemMax = netCoreWmemMax; - NetCoreOptmemMax = netCoreOptmemMax; - NetIPv4TcpMaxSynBacklog = netIPv4TcpMaxSynBacklog; - NetIPv4TcpMaxTwBuckets = netIPv4TcpMaxTwBuckets; - NetIPv4TcpFinTimeout = netIPv4TcpFinTimeout; - NetIPv4TcpKeepaliveTime = netIPv4TcpKeepaliveTime; - NetIPv4TcpKeepaliveProbes = netIPv4TcpKeepaliveProbes; - NetIPv4TcpKeepaliveIntvl = netIPv4TcpKeepaliveIntvl; - NetIPv4TcpTwReuse = netIPv4TcpTwReuse; - NetIPv4IPLocalPortRange = netIPv4IPLocalPortRange; - NetIPv4NeighDefaultGcThresh1 = netIPv4NeighDefaultGcThresh1; - NetIPv4NeighDefaultGcThresh2 = netIPv4NeighDefaultGcThresh2; - NetIPv4NeighDefaultGcThresh3 = netIPv4NeighDefaultGcThresh3; - NetNetfilterNfConntrackMax = netNetfilterNfConntrackMax; - NetNetfilterNfConntrackBuckets = netNetfilterNfConntrackBuckets; - FsInotifyMaxUserWatches = fsInotifyMaxUserWatches; - FsFileMax = fsFileMax; - FsAioMaxNr = fsAioMaxNr; - FsNrOpen = fsNrOpen; - KernelThreadsMax = kernelThreadsMax; - VmMaxMapCount = vmMaxMapCount; - VmSwappiness = vmSwappiness; - VmVfsCachePressure = vmVfsCachePressure; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Sysctl setting net.core.somaxconn. - public int? NetCoreSomaxconn { get; set; } - /// Sysctl setting net.core.netdev_max_backlog. - public int? NetCoreNetdevMaxBacklog { get; set; } - /// Sysctl setting net.core.rmem_default. - public int? NetCoreRmemDefault { get; set; } - /// Sysctl setting net.core.rmem_max. - public int? NetCoreRmemMax { get; set; } - /// Sysctl setting net.core.wmem_default. - public int? NetCoreWmemDefault { get; set; } - /// Sysctl setting net.core.wmem_max. - public int? NetCoreWmemMax { get; set; } - /// Sysctl setting net.core.optmem_max. - public int? NetCoreOptmemMax { get; set; } - /// Sysctl setting net.ipv4.tcp_max_syn_backlog. - public int? NetIPv4TcpMaxSynBacklog { get; set; } - /// Sysctl setting net.ipv4.tcp_max_tw_buckets. - public int? NetIPv4TcpMaxTwBuckets { get; set; } - /// Sysctl setting net.ipv4.tcp_fin_timeout. - public int? NetIPv4TcpFinTimeout { get; set; } - /// Sysctl setting net.ipv4.tcp_keepalive_time. - public int? NetIPv4TcpKeepaliveTime { get; set; } - /// Sysctl setting net.ipv4.tcp_keepalive_probes. - public int? NetIPv4TcpKeepaliveProbes { get; set; } - /// Sysctl setting net.ipv4.tcp_keepalive_intvl. - public int? NetIPv4TcpKeepaliveIntvl { get; set; } - /// Sysctl setting net.ipv4.tcp_tw_reuse. - public bool? NetIPv4TcpTwReuse { get; set; } - /// Sysctl setting net.ipv4.ip_local_port_range. - public string NetIPv4IPLocalPortRange { get; set; } - /// Sysctl setting net.ipv4.neigh.default.gc_thresh1. - public int? NetIPv4NeighDefaultGcThresh1 { get; set; } - /// Sysctl setting net.ipv4.neigh.default.gc_thresh2. - public int? NetIPv4NeighDefaultGcThresh2 { get; set; } - /// Sysctl setting net.ipv4.neigh.default.gc_thresh3. - public int? NetIPv4NeighDefaultGcThresh3 { get; set; } - /// Sysctl setting net.netfilter.nf_conntrack_max. - public int? NetNetfilterNfConntrackMax { get; set; } - /// Sysctl setting net.netfilter.nf_conntrack_buckets. - public int? NetNetfilterNfConntrackBuckets { get; set; } - /// Sysctl setting fs.inotify.max_user_watches. - public int? FsInotifyMaxUserWatches { get; set; } - /// Sysctl setting fs.file-max. - public int? FsFileMax { get; set; } - /// Sysctl setting fs.aio-max-nr. - public int? FsAioMaxNr { get; set; } - /// Sysctl setting fs.nr_open. - public int? FsNrOpen { get; set; } - /// Sysctl setting kernel.threads-max. - public int? KernelThreadsMax { get; set; } - /// Sysctl setting vm.max_map_count. - public int? VmMaxMapCount { get; set; } - /// Sysctl setting vm.swappiness. - public int? VmSwappiness { get; set; } - /// Sysctl setting vm.vfs_cache_pressure. - public int? VmVfsCachePressure { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TargetType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TargetType.cs new file mode 100644 index 000000000000..8b40f49e85fc --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TargetType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The target type of a skip request. + public readonly partial struct TargetType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TargetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MemberValue = "Member"; + private const string GroupValue = "Group"; + private const string StageValue = "Stage"; + private const string AfterStageWaitValue = "AfterStageWait"; + + /// Skip the update of a member. + public static TargetType Member { get; } = new TargetType(MemberValue); + /// Skip the update of a group. + public static TargetType Group { get; } = new TargetType(GroupValue); + /// Skip the update of an entire stage including the after stage wait. + public static TargetType Stage { get; } = new TargetType(StageValue); + /// Skip the update of the after stage wait of a certain stage. + public static TargetType AfterStageWait { get; } = new TargetType(AfterStageWaitValue); + /// Determines if two values are the same. + public static bool operator ==(TargetType left, TargetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TargetType left, TargetType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TargetType(string value) => new TargetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TargetType other && Equals(other); + /// + public bool Equals(TargetType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.Serialization.cs deleted file mode 100644 index 95984dde0fd4..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class TrustedAccessRoleBindingListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrustedAccessRoleBindingListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TrustedAccessRoleBindingListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrustedAccessRoleBindingListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrustedAccessRoleBindingListResult(document.RootElement, options); - } - - internal static TrustedAccessRoleBindingListResult DeserializeTrustedAccessRoleBindingListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TrustedAccessRoleBindingListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TrustedAccessRoleBindingListResult)} does not support writing '{options.Format}' format."); - } - } - - TrustedAccessRoleBindingListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrustedAccessRoleBindingListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TrustedAccessRoleBindingListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.Serialization.cs deleted file mode 100644 index 3a5b41f979a6..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerService.Models -{ - internal partial class TrustedAccessRoleListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrustedAccessRoleListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TrustedAccessRoleListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrustedAccessRoleListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrustedAccessRoleListResult(document.RootElement, options); - } - - internal static TrustedAccessRoleListResult DeserializeTrustedAccessRoleListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TrustedAccessRoleListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TrustedAccessRoleListResult)} does not support writing '{options.Format}' format."); - } - } - - TrustedAccessRoleListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrustedAccessRoleListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TrustedAccessRoleListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.cs deleted file mode 100644 index 6a5ecc232b67..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// List of trusted access roles. - internal partial class TrustedAccessRoleListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal TrustedAccessRoleListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Role list. - /// Link to next page of resources. - /// Keeps track of any properties unknown to the library. - internal TrustedAccessRoleListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Role list. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.Serialization.cs index d2be9704baed..b8af04bd31a5 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterWorkloadAutoScalerProfileKeda.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.Serialization.cs @@ -13,21 +13,21 @@ namespace Azure.ResourceManager.ContainerService.Models { - internal partial class ManagedClusterWorkloadAutoScalerProfileKeda : IUtf8JsonSerializable, IJsonModel + public partial class UpdateGroup : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfileKeda)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(UpdateGroup)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsKedaEnabled); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWrite writer.WriteEndObject(); } - ManagedClusterWorkloadAutoScalerProfileKeda IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfileKeda)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(UpdateGroup)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterWorkloadAutoScalerProfileKeda(document.RootElement, options); + return DeserializeUpdateGroup(document.RootElement, options); } - internal static ManagedClusterWorkloadAutoScalerProfileKeda DeserializeManagedClusterWorkloadAutoScalerProfileKeda(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateGroup DeserializeUpdateGroup(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +66,14 @@ internal static ManagedClusterWorkloadAutoScalerProfileKeda DeserializeManagedCl { return null; } - bool enabled = default; + string name = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("enabled"u8)) + if (property.NameEquals("name"u8)) { - enabled = property.Value.GetBoolean(); + name = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +82,38 @@ internal static ManagedClusterWorkloadAutoScalerProfileKeda DeserializeManagedCl } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterWorkloadAutoScalerProfileKeda(enabled, serializedAdditionalRawData); + return new UpdateGroup(name, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfileKeda)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateGroup)} does not support writing '{options.Format}' format."); } } - ManagedClusterWorkloadAutoScalerProfileKeda IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterWorkloadAutoScalerProfileKeda(document.RootElement, options); + return DeserializeUpdateGroup(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterWorkloadAutoScalerProfileKeda)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateGroup)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.cs index ab2df860a095..63e58315cede 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroup.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Version information about a product/service that is compatible with a service mesh revision. - public partial class CompatibleVersions + /// A group to be updated. + public partial class UpdateGroup { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,40 @@ public partial class CompatibleVersions /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public CompatibleVersions() + /// Initializes a new instance of . + /// + /// Name of the group. + /// It must match a group name of an existing fleet member. + /// + /// is null. + public UpdateGroup(string name) { - Versions = new ChangeTrackingList(); + Argument.AssertNotNull(name, nameof(name)); + + Name = name; } - /// Initializes a new instance of . - /// The product/service name. - /// Product/service versions compatible with a service mesh add-on revision. + /// Initializes a new instance of . + /// + /// Name of the group. + /// It must match a group name of an existing fleet member. + /// /// Keeps track of any properties unknown to the library. - internal CompatibleVersions(string name, IList versions, IDictionary serializedAdditionalRawData) + internal UpdateGroup(string name, IDictionary serializedAdditionalRawData) { Name = name; - Versions = versions; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The product/service name. + /// Initializes a new instance of for deserialization. + internal UpdateGroup() + { + } + + /// + /// Name of the group. + /// It must match a group name of an existing fleet member. + /// public string Name { get; set; } - /// Product/service versions compatible with a service mesh add-on revision. - public IList Versions { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.Serialization.cs index 9f2efb491d93..baa6289f65c6 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTrustedAccessRole.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.Serialization.cs @@ -13,34 +13,34 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceTrustedAccessRole : IUtf8JsonSerializable, IJsonModel + public partial class UpdateGroupStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRole)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(SourceResourceType)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("sourceResourceType"u8); - writer.WriteStringValue(SourceResourceType); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); } if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (options.Format != "W" && Optional.IsCollectionDefined(Rules)) + if (options.Format != "W" && Optional.IsCollectionDefined(Members)) { - writer.WritePropertyName("rules"u8); + writer.WritePropertyName("members"u8); writer.WriteStartArray(); - foreach (var item in Rules) + foreach (var item in Members) { writer.WriteObjectValue(item, options); } @@ -64,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteEndObject(); } - ContainerServiceTrustedAccessRole IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateGroupStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRole)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTrustedAccessRole(document.RootElement, options); + return DeserializeUpdateGroupStatus(document.RootElement, options); } - internal static ContainerServiceTrustedAccessRole DeserializeContainerServiceTrustedAccessRole(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateGroupStatus DeserializeUpdateGroupStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -84,16 +84,20 @@ internal static ContainerServiceTrustedAccessRole DeserializeContainerServiceTru { return null; } - string sourceResourceType = default; + UpdateStatus status = default; string name = default; - IReadOnlyList rules = default; + IReadOnlyList members = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sourceResourceType"u8)) + if (property.NameEquals("status"u8)) { - sourceResourceType = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); continue; } if (property.NameEquals("name"u8)) @@ -101,18 +105,18 @@ internal static ContainerServiceTrustedAccessRole DeserializeContainerServiceTru name = property.Value.GetString(); continue; } - if (property.NameEquals("rules"u8)) + if (property.NameEquals("members"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ContainerServiceTrustedAccessRoleRule.DeserializeContainerServiceTrustedAccessRoleRule(item, options)); + array.Add(MemberUpdateStatus.DeserializeMemberUpdateStatus(item, options)); } - rules = array; + members = array; continue; } if (options.Format != "W") @@ -121,38 +125,38 @@ internal static ContainerServiceTrustedAccessRole DeserializeContainerServiceTru } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceTrustedAccessRole(sourceResourceType, name, rules ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new UpdateGroupStatus(status, name, members ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRole)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support writing '{options.Format}' format."); } } - ContainerServiceTrustedAccessRole IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateGroupStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTrustedAccessRole(document.RootElement, options); + return DeserializeUpdateGroupStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTrustedAccessRole)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateGroupStatus)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.cs index 649ef5f06574..54f504f4c32f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServicePrivateLinkServiceConnectionState.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateGroupStatus.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// The state of a private link service connection. - public partial class ContainerServicePrivateLinkServiceConnectionState + /// The status of a UpdateGroup. + public partial class UpdateGroupStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,30 @@ public partial class ContainerServicePrivateLinkServiceConnectionState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ContainerServicePrivateLinkServiceConnectionState() + /// Initializes a new instance of . + internal UpdateGroupStatus() { + Members = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The private link service connection status. - /// The private link service connection description. + /// Initializes a new instance of . + /// The status of the UpdateGroup. + /// The name of the UpdateGroup. + /// The list of member this UpdateGroup updates. /// Keeps track of any properties unknown to the library. - internal ContainerServicePrivateLinkServiceConnectionState(ContainerServicePrivateLinkServiceConnectionStatus? status, string description, IDictionary serializedAdditionalRawData) + internal UpdateGroupStatus(UpdateStatus status, string name, IReadOnlyList members, IDictionary serializedAdditionalRawData) { Status = status; - Description = description; + Name = name; + Members = members; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The private link service connection status. - public ContainerServicePrivateLinkServiceConnectionStatus? Status { get; set; } - /// The private link service connection description. - public string Description { get; set; } + /// The status of the UpdateGroup. + public UpdateStatus Status { get; } + /// The name of the UpdateGroup. + public string Name { get; } + /// The list of member this UpdateGroup updates. + public IReadOnlyList Members { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.Serialization.cs index 703c8011da44..98ff4fbc1fb1 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioIngressGateway.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.Serialization.cs @@ -13,23 +13,31 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class IstioIngressGateway : IUtf8JsonSerializable, IJsonModel + internal partial class UpdateRunListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioIngressGateway)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.ToString()); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -48,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - IstioIngressGateway IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateRunListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioIngressGateway)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioIngressGateway(document.RootElement, options); + return DeserializeUpdateRunListResult(document.RootElement, options); } - internal static IstioIngressGateway DeserializeIstioIngressGateway(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateRunListResult DeserializeUpdateRunListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -68,20 +76,29 @@ internal static IstioIngressGateway DeserializeIstioIngressGateway(JsonElement e { return null; } - IstioIngressGatewayMode mode = default; - bool enabled = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mode"u8)) + if (property.NameEquals("value"u8)) { - mode = new IstioIngressGatewayMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateRunData.DeserializeUpdateRunData(item, options)); + } + value = array; continue; } - if (property.NameEquals("enabled"u8)) + if (property.NameEquals("nextLink"u8)) { - enabled = property.Value.GetBoolean(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -90,38 +107,38 @@ internal static IstioIngressGateway DeserializeIstioIngressGateway(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new IstioIngressGateway(mode, enabled, serializedAdditionalRawData); + return new UpdateRunListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(IstioIngressGateway)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support writing '{options.Format}' format."); } } - IstioIngressGateway IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateRunListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIstioIngressGateway(document.RootElement, options); + return DeserializeUpdateRunListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IstioIngressGateway)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.cs index 3870f8d6d37a..91cd7d68193d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceConfigurationListResult.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunListResult.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ContainerService.Models { - /// The response from the List maintenance configurations operation. - internal partial class ContainerServiceMaintenanceConfigurationListResult + /// The response of a UpdateRun list operation. + internal partial class UpdateRunListResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,35 @@ internal partial class ContainerServiceMaintenanceConfigurationListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ContainerServiceMaintenanceConfigurationListResult() + /// Initializes a new instance of . + /// The UpdateRun items on this page. + /// is null. + internal UpdateRunListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } - /// Initializes a new instance of . - /// The list of maintenance configurations. - /// The URL to get the next set of maintenance configuration results. + /// Initializes a new instance of . + /// The UpdateRun items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceConfigurationListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal UpdateRunListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of maintenance configurations. - public IReadOnlyList Value { get; } - /// The URL to get the next set of maintenance configuration results. - public string NextLink { get; } + /// Initializes a new instance of for deserialization. + internal UpdateRunListResult() + { + } + + /// The UpdateRun items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunProvisioningState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunProvisioningState.cs new file mode 100644 index 000000000000..ad20f6d08837 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The provisioning state of the UpdateRun resource. + public readonly partial struct UpdateRunProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UpdateRunProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static UpdateRunProvisioningState Succeeded { get; } = new UpdateRunProvisioningState(SucceededValue); + /// Resource creation failed. + public static UpdateRunProvisioningState Failed { get; } = new UpdateRunProvisioningState(FailedValue); + /// Resource creation was canceled. + public static UpdateRunProvisioningState Canceled { get; } = new UpdateRunProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(UpdateRunProvisioningState left, UpdateRunProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UpdateRunProvisioningState left, UpdateRunProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator UpdateRunProvisioningState(string value) => new UpdateRunProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UpdateRunProvisioningState other && Equals(other); + /// + public bool Equals(UpdateRunProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.Serialization.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.Serialization.cs index feb7069d50b3..f926ac346d19 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioComponents.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.Serialization.cs @@ -13,39 +13,39 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class IstioComponents : IUtf8JsonSerializable, IJsonModel + public partial class UpdateRunStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioComponents)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(IngressGateways)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("ingressGateways"u8); - writer.WriteStartArray(); - foreach (var item in IngressGateways) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); } - if (Optional.IsCollectionDefined(EgressGateways)) + if (options.Format != "W" && Optional.IsCollectionDefined(Stages)) { - writer.WritePropertyName("egressGateways"u8); + writer.WritePropertyName("stages"u8); writer.WriteStartArray(); - foreach (var item in EgressGateways) + foreach (var item in Stages) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } + if (options.Format != "W" && Optional.IsDefined(NodeImageSelection)) + { + writer.WritePropertyName("nodeImageSelection"u8); + writer.WriteObjectValue(NodeImageSelection, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -64,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WriteEndObject(); } - IstioComponents IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateRunStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioComponents)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioComponents(document.RootElement, options); + return DeserializeUpdateRunStatus(document.RootElement, options); } - internal static IstioComponents DeserializeIstioComponents(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateRunStatus DeserializeUpdateRunStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -84,38 +84,43 @@ internal static IstioComponents DeserializeIstioComponents(JsonElement element, { return null; } - IList ingressGateways = default; - IList egressGateways = default; + UpdateStatus status = default; + IReadOnlyList stages = default; + NodeImageSelectionStatus nodeImageSelection = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("ingressGateways"u8)) + if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IstioIngressGateway.DeserializeIstioIngressGateway(item, options)); - } - ingressGateways = array; + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); continue; } - if (property.NameEquals("egressGateways"u8)) + if (property.NameEquals("stages"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(IstioEgressGateway.DeserializeIstioEgressGateway(item, options)); + array.Add(UpdateStageStatus.DeserializeUpdateStageStatus(item, options)); + } + stages = array; + continue; + } + if (property.NameEquals("nodeImageSelection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; } - egressGateways = array; + nodeImageSelection = NodeImageSelectionStatus.DeserializeNodeImageSelectionStatus(property.Value, options); continue; } if (options.Format != "W") @@ -124,38 +129,38 @@ internal static IstioComponents DeserializeIstioComponents(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new IstioComponents(ingressGateways ?? new ChangeTrackingList(), egressGateways ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new UpdateRunStatus(status, stages ?? new ChangeTrackingList(), nodeImageSelection, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(IstioComponents)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support writing '{options.Format}' format."); } } - IstioComponents IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateRunStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIstioComponents(document.RootElement, options); + return DeserializeUpdateRunStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IstioComponents)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStatus)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.cs similarity index 50% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.cs index 72c24687c3ee..d91735554cb7 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceMaintenanceAbsoluteMonthlySchedule.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStatus.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. - public partial class ContainerServiceMaintenanceAbsoluteMonthlySchedule + /// The status of a UpdateRun. + public partial class UpdateRunStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,34 +45,35 @@ public partial class ContainerServiceMaintenanceAbsoluteMonthlySchedule /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Specifies the number of months between each set of occurrences. - /// The date of the month. - public ContainerServiceMaintenanceAbsoluteMonthlySchedule(int intervalMonths, int dayOfMonth) + /// Initializes a new instance of . + internal UpdateRunStatus() { - IntervalMonths = intervalMonths; - DayOfMonth = dayOfMonth; + Stages = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Specifies the number of months between each set of occurrences. - /// The date of the month. + /// Initializes a new instance of . + /// The status of the UpdateRun. + /// The stages composing an update run. Stages are run sequentially withing an UpdateRun. + /// The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is `Consistent`. /// Keeps track of any properties unknown to the library. - internal ContainerServiceMaintenanceAbsoluteMonthlySchedule(int intervalMonths, int dayOfMonth, IDictionary serializedAdditionalRawData) + internal UpdateRunStatus(UpdateStatus status, IReadOnlyList stages, NodeImageSelectionStatus nodeImageSelection, IDictionary serializedAdditionalRawData) { - IntervalMonths = intervalMonths; - DayOfMonth = dayOfMonth; + Status = status; + Stages = stages; + NodeImageSelection = nodeImageSelection; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContainerServiceMaintenanceAbsoluteMonthlySchedule() + /// The status of the UpdateRun. + public UpdateStatus Status { get; } + /// The stages composing an update run. Stages are run sequentially withing an UpdateRun. + public IReadOnlyList Stages { get; } + /// The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is `Consistent`. + internal NodeImageSelectionStatus NodeImageSelection { get; } + /// The image versions to upgrade the nodes to. + public IReadOnlyList SelectedNodeImageVersions { + get => NodeImageSelection?.SelectedNodeImageVersions; } - - /// Specifies the number of months between each set of occurrences. - public int IntervalMonths { get; set; } - /// The date of the month. - public int DayOfMonth { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.Serialization.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.Serialization.cs index b64068770f51..393adb2d3654 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterSku.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.Serialization.cs @@ -13,29 +13,26 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ManagedClusterSku : IUtf8JsonSerializable, IJsonModel + internal partial class UpdateRunStrategy : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterSku)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Name)) + writer.WritePropertyName("stages"u8); + writer.WriteStartArray(); + foreach (var item in Stages) { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name.Value.ToString()); - } - if (Optional.IsDefined(Tier)) - { - writer.WritePropertyName("tier"u8); - writer.WriteStringValue(Tier.Value.ToString()); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -54,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - ManagedClusterSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateRunStrategy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterSku)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterSku(document.RootElement, options); + return DeserializeUpdateRunStrategy(document.RootElement, options); } - internal static ManagedClusterSku DeserializeManagedClusterSku(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateRunStrategy DeserializeUpdateRunStrategy(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -74,28 +71,19 @@ internal static ManagedClusterSku DeserializeManagedClusterSku(JsonElement eleme { return null; } - ManagedClusterSkuName? name = default; - ManagedClusterSkuTier? tier = default; + IList stages = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - name = new ManagedClusterSkuName(property.Value.GetString()); - continue; - } - if (property.NameEquals("tier"u8)) + if (property.NameEquals("stages"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(UpdateStage.DeserializeUpdateStage(item, options)); } - tier = new ManagedClusterSkuTier(property.Value.GetString()); + stages = array; continue; } if (options.Format != "W") @@ -104,38 +92,38 @@ internal static ManagedClusterSku DeserializeManagedClusterSku(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterSku(name, tier, serializedAdditionalRawData); + return new UpdateRunStrategy(stages, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ManagedClusterSku)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support writing '{options.Format}' format."); } } - ManagedClusterSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateRunStrategy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterSku(document.RootElement, options); + return DeserializeUpdateRunStrategy(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterSku)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunStrategy)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.cs index c75432362def..071f94a223ad 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateRunStrategy.cs @@ -7,11 +7,20 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ContainerService.Models { - /// OS option property. - public partial class ContainerServiceOSOptionProperty + /// + /// Defines the update sequence of the clusters via stages and groups. + /// + /// Stages within a run are executed sequentially one after another. + /// Groups within a stage are executed in parallel. + /// Member clusters within a group are updated sequentially one after another. + /// + /// A valid strategy contains no duplicate groups within or across stages. + /// + internal partial class UpdateRunStrategy { /// /// Keeps track of any properties unknown to the library. @@ -45,37 +54,31 @@ public partial class ContainerServiceOSOptionProperty /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. - /// is null. - internal ContainerServiceOSOptionProperty(string osType, bool enableFipsImage) + /// Initializes a new instance of . + /// The list of stages that compose this update run. Min size: 1. + /// is null. + public UpdateRunStrategy(IEnumerable stages) { - Argument.AssertNotNull(osType, nameof(osType)); + Argument.AssertNotNull(stages, nameof(stages)); - OSType = osType; - EnableFipsImage = enableFipsImage; + Stages = stages.ToList(); } - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. + /// Initializes a new instance of . + /// The list of stages that compose this update run. Min size: 1. /// Keeps track of any properties unknown to the library. - internal ContainerServiceOSOptionProperty(string osType, bool enableFipsImage, IDictionary serializedAdditionalRawData) + internal UpdateRunStrategy(IList stages, IDictionary serializedAdditionalRawData) { - OSType = osType; - EnableFipsImage = enableFipsImage; + Stages = stages; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContainerServiceOSOptionProperty() + /// Initializes a new instance of for deserialization. + internal UpdateRunStrategy() { } - /// The OS type. - public string OSType { get; } - /// Whether the image is FIPS-enabled. - public bool EnableFipsImage { get; } + /// The list of stages that compose this update run. Min size: 1. + public IList Stages { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.Serialization.cs index 5913204b6375..3cb4604e2003 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeInWeek.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.Serialization.cs @@ -13,34 +13,36 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceTimeInWeek : IUtf8JsonSerializable, IJsonModel + public partial class UpdateStage : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTimeInWeek)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStage)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Day)) + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsCollectionDefined(Groups)) { - writer.WritePropertyName("day"u8); - writer.WriteStringValue(Day.Value.ToString()); - } - if (Optional.IsCollectionDefined(HourSlots)) - { - writer.WritePropertyName("hourSlots"u8); + writer.WritePropertyName("groups"u8); writer.WriteStartArray(); - foreach (var item in HourSlots) + foreach (var item in Groups) { - writer.WriteNumberValue(item); + writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } + if (Optional.IsDefined(AfterStageWaitInSeconds)) + { + writer.WritePropertyName("afterStageWaitInSeconds"u8); + writer.WriteNumberValue(AfterStageWaitInSeconds.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -59,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - ContainerServiceTimeInWeek IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateStage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceTimeInWeek)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStage)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceTimeInWeek(document.RootElement, options); + return DeserializeUpdateStage(document.RootElement, options); } - internal static ContainerServiceTimeInWeek DeserializeContainerServiceTimeInWeek(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateStage DeserializeUpdateStage(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,33 +81,39 @@ internal static ContainerServiceTimeInWeek DeserializeContainerServiceTimeInWeek { return null; } - ContainerServiceWeekDay? day = default; - IList hourSlots = default; + string name = default; + IList groups = default; + int? afterStageWaitInSeconds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("day"u8)) + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("groups"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - day = new ContainerServiceWeekDay(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateGroup.DeserializeUpdateGroup(item, options)); + } + groups = array; continue; } - if (property.NameEquals("hourSlots"u8)) + if (property.NameEquals("afterStageWaitInSeconds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetInt32()); - } - hourSlots = array; + afterStageWaitInSeconds = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -114,38 +122,38 @@ internal static ContainerServiceTimeInWeek DeserializeContainerServiceTimeInWeek } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceTimeInWeek(day, hourSlots ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new UpdateStage(name, groups ?? new ChangeTrackingList(), afterStageWaitInSeconds, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceTimeInWeek)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStage)} does not support writing '{options.Format}' format."); } } - ContainerServiceTimeInWeek IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateStage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceTimeInWeek(document.RootElement, options); + return DeserializeUpdateStage(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceTimeInWeek)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStage)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.cs new file mode 100644 index 000000000000..603566ad05b3 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStage.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Defines a stage which contains the groups to update and the steps to take (e.g., wait for a time period) before starting the next stage. + public partial class UpdateStage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the stage. Must be unique within the UpdateRun. + /// is null. + public UpdateStage(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Groups = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the stage. Must be unique within the UpdateRun. + /// Defines the groups to be executed in parallel in this stage. Duplicate groups are not allowed. Min size: 1. + /// The time in seconds to wait at the end of this stage before starting the next one. Defaults to 0 seconds if unspecified. + /// Keeps track of any properties unknown to the library. + internal UpdateStage(string name, IList groups, int? afterStageWaitInSeconds, IDictionary serializedAdditionalRawData) + { + Name = name; + Groups = groups; + AfterStageWaitInSeconds = afterStageWaitInSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UpdateStage() + { + } + + /// The name of the stage. Must be unique within the UpdateRun. + public string Name { get; set; } + /// Defines the groups to be executed in parallel in this stage. Duplicate groups are not allowed. Min size: 1. + public IList Groups { get; } + /// The time in seconds to wait at the end of this stage before starting the next one. Defaults to 0 seconds if unspecified. + public int? AfterStageWaitInSeconds { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.Serialization.cs similarity index 53% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.Serialization.cs index 33e1ed24fb7b..f81088842e9c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.Serialization.cs @@ -13,44 +13,43 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class KubernetesVersion : IUtf8JsonSerializable, IJsonModel + public partial class UpdateStageStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesVersion)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Version)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); } - if (Optional.IsDefined(Capabilities)) + if (options.Format != "W" && Optional.IsDefined(Name)) { - writer.WritePropertyName("capabilities"u8); - writer.WriteObjectValue(Capabilities, options); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); } - if (Optional.IsDefined(IsPreview)) + if (options.Format != "W" && Optional.IsCollectionDefined(Groups)) { - writer.WritePropertyName("isPreview"u8); - writer.WriteBooleanValue(IsPreview.Value); - } - if (Optional.IsCollectionDefined(PatchVersions)) - { - writer.WritePropertyName("patchVersions"u8); - writer.WriteStartObject(); - foreach (var item in PatchVersions) + writer.WritePropertyName("groups"u8); + writer.WriteStartArray(); + foreach (var item in Groups) { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); + writer.WriteObjectValue(item, options); } - writer.WriteEndObject(); + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(AfterStageWaitStatus)) + { + writer.WritePropertyName("afterStageWaitStatus"u8); + writer.WriteObjectValue(AfterStageWaitStatus, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -70,19 +69,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - KubernetesVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateStageStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KubernetesVersion)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKubernetesVersion(document.RootElement, options); + return DeserializeUpdateStageStatus(document.RootElement, options); } - internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateStageStatus DeserializeUpdateStageStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -90,49 +89,49 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme { return null; } - string version = default; - KubernetesVersionCapabilities capabilities = default; - bool? isPreview = default; - IReadOnlyDictionary patchVersions = default; + UpdateStatus status = default; + string name = default; + IReadOnlyList groups = default; + WaitStatus afterStageWaitStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("version"u8)) - { - version = property.Value.GetString(); - continue; - } - if (property.NameEquals("capabilities"u8)) + if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - capabilities = KubernetesVersionCapabilities.DeserializeKubernetesVersionCapabilities(property.Value, options); + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); continue; } - if (property.NameEquals("isPreview"u8)) + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("groups"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - isPreview = property.Value.GetBoolean(); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UpdateGroupStatus.DeserializeUpdateGroupStatus(item, options)); + } + groups = array; continue; } - if (property.NameEquals("patchVersions"u8)) + if (property.NameEquals("afterStageWaitStatus"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, KubernetesPatchVersion.DeserializeKubernetesPatchVersion(property0.Value, options)); - } - patchVersions = dictionary; + afterStageWaitStatus = WaitStatus.DeserializeWaitStatus(property.Value, options); continue; } if (options.Format != "W") @@ -141,38 +140,38 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new KubernetesVersion(version, capabilities, isPreview, patchVersions ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new UpdateStageStatus(status, name, groups ?? new ChangeTrackingList(), afterStageWaitStatus, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(KubernetesVersion)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support writing '{options.Format}' format."); } } - KubernetesVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateStageStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKubernetesVersion(document.RootElement, options); + return DeserializeUpdateStageStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(KubernetesVersion)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStageStatus)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.cs index d4037c685724..8c8f51f3e077 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStageStatus.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// Settings for overrides when upgrading a cluster. - public partial class UpgradeOverrideSettings + /// The status of a UpdateStage. + public partial class UpdateStageStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,34 @@ public partial class UpgradeOverrideSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public UpgradeOverrideSettings() + /// Initializes a new instance of . + internal UpdateStageStatus() { + Groups = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution. - /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect. + /// Initializes a new instance of . + /// The status of the UpdateStage. + /// The name of the UpdateStage. + /// The list of groups to be updated as part of this UpdateStage. + /// The status of the wait period configured on the UpdateStage. /// Keeps track of any properties unknown to the library. - internal UpgradeOverrideSettings(bool? forceUpgrade, DateTimeOffset? until, IDictionary serializedAdditionalRawData) + internal UpdateStageStatus(UpdateStatus status, string name, IReadOnlyList groups, WaitStatus afterStageWaitStatus, IDictionary serializedAdditionalRawData) { - ForceUpgrade = forceUpgrade; - Until = until; + Status = status; + Name = name; + Groups = groups; + AfterStageWaitStatus = afterStageWaitStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution. - public bool? ForceUpgrade { get; set; } - /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect. - public DateTimeOffset? Until { get; set; } + /// The status of the UpdateStage. + public UpdateStatus Status { get; } + /// The name of the UpdateStage. + public string Name { get; } + /// The list of groups to be updated as part of this UpdateStage. + public IReadOnlyList Groups { get; } + /// The status of the wait period configured on the UpdateStage. + public WaitStatus AfterStageWaitStatus { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateState.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateState.cs new file mode 100644 index 000000000000..77d5b3b85c28 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The state of the UpdateRun, UpdateStage, UpdateGroup, or MemberUpdate. + public readonly partial struct UpdateState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UpdateState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string RunningValue = "Running"; + private const string StoppingValue = "Stopping"; + private const string StoppedValue = "Stopped"; + private const string SkippedValue = "Skipped"; + private const string FailedValue = "Failed"; + private const string CompletedValue = "Completed"; + + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has not been started. + public static UpdateState NotStarted { get; } = new UpdateState(NotStartedValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is running. + public static UpdateState Running { get; } = new UpdateState(RunningValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is being stopped. + public static UpdateState Stopping { get; } = new UpdateState(StoppingValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has stopped. + public static UpdateState Stopped { get; } = new UpdateState(StoppedValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has been skipped. + public static UpdateState Skipped { get; } = new UpdateState(SkippedValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has failed. + public static UpdateState Failed { get; } = new UpdateState(FailedValue); + /// The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has completed. + public static UpdateState Completed { get; } = new UpdateState(CompletedValue); + /// Determines if two values are the same. + public static bool operator ==(UpdateState left, UpdateState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UpdateState left, UpdateState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator UpdateState(string value) => new UpdateState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UpdateState other && Equals(other); + /// + public bool Equals(UpdateState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.Serialization.cs index 1dc8f566dadd..dd24052103e4 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MeshRevision.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.Serialization.cs @@ -13,43 +13,38 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class MeshRevision : IUtf8JsonSerializable, IJsonModel + public partial class UpdateStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevision)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStatus)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Revision)) + if (options.Format != "W" && Optional.IsDefined(StartOn)) { - writer.WritePropertyName("revision"u8); - writer.WriteStringValue(Revision); + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); } - if (Optional.IsCollectionDefined(Upgrades)) + if (options.Format != "W" && Optional.IsDefined(CompletedOn)) { - writer.WritePropertyName("upgrades"u8); - writer.WriteStartArray(); - foreach (var item in Upgrades) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); + writer.WritePropertyName("completedTime"u8); + writer.WriteStringValue(CompletedOn.Value, "O"); } - if (Optional.IsCollectionDefined(CompatibleWith)) + if (options.Format != "W" && Optional.IsDefined(State)) { - writer.WritePropertyName("compatibleWith"u8); - writer.WriteStartArray(); - foreach (var item in CompatibleWith) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -69,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti writer.WriteEndObject(); } - MeshRevision IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevision)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(UpdateStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshRevision(document.RootElement, options); + return DeserializeUpdateStatus(document.RootElement, options); } - internal static MeshRevision DeserializeMeshRevision(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateStatus DeserializeUpdateStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,44 +84,48 @@ internal static MeshRevision DeserializeMeshRevision(JsonElement element, ModelR { return null; } - string revision = default; - IList upgrades = default; - IList compatibleWith = default; + DateTimeOffset? startTime = default; + DateTimeOffset? completedTime = default; + UpdateState? state = default; + ResponseError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("revision"u8)) + if (property.NameEquals("startTime"u8)) { - revision = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("upgrades"u8)) + if (property.NameEquals("completedTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - upgrades = array; + completedTime = property.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("compatibleWith"u8)) + if (property.NameEquals("state"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + state = new UpdateState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) { - array.Add(CompatibleVersions.DeserializeCompatibleVersions(item, options)); + continue; } - compatibleWith = array; + error = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (options.Format != "W") @@ -135,38 +134,38 @@ internal static MeshRevision DeserializeMeshRevision(JsonElement element, ModelR } } serializedAdditionalRawData = rawDataDictionary; - return new MeshRevision(revision, upgrades ?? new ChangeTrackingList(), compatibleWith ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new UpdateStatus(startTime, completedTime, state, error, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MeshRevision)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStatus)} does not support writing '{options.Format}' format."); } } - MeshRevision IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshRevision(document.RootElement, options); + return DeserializeUpdateStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MeshRevision)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateStatus)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.cs index 0ac3eb2d86f2..95c249edf5c8 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceTimeSpan.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpdateStatus.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ContainerService.Models { - /// For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - public partial class ContainerServiceTimeSpan + /// The status for an operation or group of operations. + public partial class UpdateStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,33 @@ public partial class ContainerServiceTimeSpan /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ContainerServiceTimeSpan() + /// Initializes a new instance of . + internal UpdateStatus() { } - /// Initializes a new instance of . - /// The start of a time span. - /// The end of a time span. + /// Initializes a new instance of . + /// The time the operation or group was started. + /// The time the operation or group was completed. + /// The State of the operation or group. + /// The error details when a failure is encountered. /// Keeps track of any properties unknown to the library. - internal ContainerServiceTimeSpan(DateTimeOffset? startOn, DateTimeOffset? endOn, IDictionary serializedAdditionalRawData) + internal UpdateStatus(DateTimeOffset? startOn, DateTimeOffset? completedOn, UpdateState? state, ResponseError error, IDictionary serializedAdditionalRawData) { StartOn = startOn; - EndOn = endOn; + CompletedOn = completedOn; + State = state; + Error = error; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The start of a time span. - public DateTimeOffset? StartOn { get; set; } - /// The end of a time span. - public DateTimeOffset? EndOn { get; set; } + /// The time the operation or group was started. + public DateTimeOffset? StartOn { get; } + /// The time the operation or group was completed. + public DateTimeOffset? CompletedOn { get; } + /// The State of the operation or group. + public UpdateState? State { get; } + /// The error details when a failure is encountered. + public ResponseError Error { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeChannel.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeChannel.cs deleted file mode 100644 index ea05cd164e1b..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeChannel.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). - public readonly partial struct UpgradeChannel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public UpgradeChannel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RapidValue = "rapid"; - private const string StableValue = "stable"; - private const string PatchValue = "patch"; - private const string NodeImageValue = "node-image"; - private const string NoneValue = "none"; - - /// Automatically upgrade the cluster to the latest supported patch release on the latest supported minor version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor version where N is the latest supported minor version, the cluster first upgrades to the latest supported patch version on N-1 minor version. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is upgraded to 1.18.6, then is upgraded to 1.19.1. - public static UpgradeChannel Rapid { get; } = new UpgradeChannel(RapidValue); - /// Automatically upgrade the cluster to the latest supported patch release on minor version N-1, where N is the latest supported minor version. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to 1.18.6. - public static UpgradeChannel Stable { get; } = new UpgradeChannel(StableValue); - /// Automatically upgrade the cluster to the latest supported patch version when it becomes available while keeping the minor version the same. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to 1.17.9. - public static UpgradeChannel Patch { get; } = new UpgradeChannel(PatchValue); - /// Automatically upgrade the node image to the latest version available. Consider using nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from Kubernetes version patching. - public static UpgradeChannel NodeImage { get; } = new UpgradeChannel(NodeImageValue); - /// Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. - public static UpgradeChannel None { get; } = new UpgradeChannel(NoneValue); - /// Determines if two values are the same. - public static bool operator ==(UpgradeChannel left, UpgradeChannel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(UpgradeChannel left, UpgradeChannel right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator UpgradeChannel(string value) => new UpgradeChannel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is UpgradeChannel other && Equals(other); - /// - public bool Equals(UpgradeChannel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.Serialization.cs index 7a07545bb951..181902491d9a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/UpgradeOverrideSettings.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.Serialization.cs @@ -13,28 +13,28 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class UpgradeOverrideSettings : IUtf8JsonSerializable, IJsonModel + public partial class WaitStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UpgradeOverrideSettings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(WaitStatus)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ForceUpgrade)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("forceUpgrade"u8); - writer.WriteBooleanValue(ForceUpgrade.Value); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); } - if (Optional.IsDefined(Until)) + if (options.Format != "W" && Optional.IsDefined(WaitDurationInSeconds)) { - writer.WritePropertyName("until"u8); - writer.WriteStringValue(Until.Value, "O"); + writer.WritePropertyName("waitDurationInSeconds"u8); + writer.WriteNumberValue(WaitDurationInSeconds.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - UpgradeOverrideSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + WaitStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UpgradeOverrideSettings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(WaitStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUpgradeOverrideSettings(document.RootElement, options); + return DeserializeWaitStatus(document.RootElement, options); } - internal static UpgradeOverrideSettings DeserializeUpgradeOverrideSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static WaitStatus DeserializeWaitStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -74,28 +74,28 @@ internal static UpgradeOverrideSettings DeserializeUpgradeOverrideSettings(JsonE { return null; } - bool? forceUpgrade = default; - DateTimeOffset? until = default; + UpdateStatus status = default; + int? waitDurationInSeconds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("forceUpgrade"u8)) + if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - forceUpgrade = property.Value.GetBoolean(); + status = UpdateStatus.DeserializeUpdateStatus(property.Value, options); continue; } - if (property.NameEquals("until"u8)) + if (property.NameEquals("waitDurationInSeconds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - until = property.Value.GetDateTimeOffset("O"); + waitDurationInSeconds = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -104,38 +104,38 @@ internal static UpgradeOverrideSettings DeserializeUpgradeOverrideSettings(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new UpgradeOverrideSettings(forceUpgrade, until, serializedAdditionalRawData); + return new WaitStatus(status, waitDurationInSeconds, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(UpgradeOverrideSettings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(WaitStatus)} does not support writing '{options.Format}' format."); } } - UpgradeOverrideSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + WaitStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeUpgradeOverrideSettings(document.RootElement, options); + return DeserializeWaitStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(UpgradeOverrideSettings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(WaitStatus)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.cs similarity index 66% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.cs index 283d813a1a87..b03e4153a30a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceCreationData.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WaitStatus.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ContainerService.Models { - /// Data used when creating a target resource from a source resource. - internal partial class ContainerServiceCreationData + /// The status of the wait duration. + public partial class WaitStatus { /// /// Keeps track of any properties unknown to the library. @@ -46,21 +45,25 @@ internal partial class ContainerServiceCreationData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ContainerServiceCreationData() + /// Initializes a new instance of . + internal WaitStatus() { } - /// Initializes a new instance of . - /// This is the ARM ID of the source object to be used to create the target object. + /// Initializes a new instance of . + /// The status of the wait duration. + /// The wait duration configured in seconds. /// Keeps track of any properties unknown to the library. - internal ContainerServiceCreationData(ResourceIdentifier sourceResourceId, IDictionary serializedAdditionalRawData) + internal WaitStatus(UpdateStatus status, int? waitDurationInSeconds, IDictionary serializedAdditionalRawData) { - SourceResourceId = sourceResourceId; + Status = status; + WaitDurationInSeconds = waitDurationInSeconds; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// This is the ARM ID of the source object to be used to create the target object. - public ResourceIdentifier SourceResourceId { get; set; } + /// The status of the wait duration. + public UpdateStatus Status { get; } + /// The wait duration configured in seconds. + public int? WaitDurationInSeconds { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs deleted file mode 100644 index 8b9918756a59..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Windows gMSA Profile in the managed cluster. - public partial class WindowsGmsaProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public WindowsGmsaProfile() - { - } - - /// Initializes a new instance of . - /// Specifies whether to enable Windows gMSA in the managed cluster. - /// Specifies the DNS server for Windows gMSA. <br><br> Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - /// Specifies the root domain name for Windows gMSA. <br><br> Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - /// Keeps track of any properties unknown to the library. - internal WindowsGmsaProfile(bool? isEnabled, string dnsServer, string rootDomainName, IDictionary serializedAdditionalRawData) - { - IsEnabled = isEnabled; - DnsServer = dnsServer; - RootDomainName = rootDomainName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specifies whether to enable Windows gMSA in the managed cluster. - public bool? IsEnabled { get; set; } - /// Specifies the DNS server for Windows gMSA. <br><br> Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - public string DnsServer { get; set; } - /// Specifies the root domain name for Windows gMSA. <br><br> Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. - public string RootDomainName { get; set; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsVmLicenseType.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsVmLicenseType.cs deleted file mode 100644 index a85d0be9e3dd..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsVmLicenseType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. - public readonly partial struct WindowsVmLicenseType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public WindowsVmLicenseType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string WindowsServerValue = "Windows_Server"; - - /// No additional licensing is applied. - public static WindowsVmLicenseType None { get; } = new WindowsVmLicenseType(NoneValue); - /// Enables Azure Hybrid User Benefits for Windows VMs. - public static WindowsVmLicenseType WindowsServer { get; } = new WindowsVmLicenseType(WindowsServerValue); - /// Determines if two values are the same. - public static bool operator ==(WindowsVmLicenseType left, WindowsVmLicenseType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(WindowsVmLicenseType left, WindowsVmLicenseType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator WindowsVmLicenseType(string value) => new WindowsVmLicenseType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is WindowsVmLicenseType other && Equals(other); - /// - public bool Equals(WindowsVmLicenseType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WorkloadRuntime.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WorkloadRuntime.cs deleted file mode 100644 index 5234e2c2f3a2..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WorkloadRuntime.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerService.Models -{ - /// Determines the type of workload a node can run. - public readonly partial struct WorkloadRuntime : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public WorkloadRuntime(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OciContainerValue = "OCIContainer"; - private const string WasmWasiValue = "WasmWasi"; - - /// Nodes will use Kubelet to run standard OCI container workloads. - public static WorkloadRuntime OciContainer { get; } = new WorkloadRuntime(OciContainerValue); - /// Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). - public static WorkloadRuntime WasmWasi { get; } = new WorkloadRuntime(WasmWasiValue); - /// Determines if two values are the same. - public static bool operator ==(WorkloadRuntime left, WorkloadRuntime right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(WorkloadRuntime left, WorkloadRuntime right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator WorkloadRuntime(string value) => new WorkloadRuntime(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is WorkloadRuntime other && Equals(other); - /// - public bool Equals(WorkloadRuntime other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.Serialization.cs deleted file mode 100644 index 57ed6514c01a..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.Serialization.cs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class OSOptionProfileData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("osOptionPropertyList"u8); - writer.WriteStartArray(); - foreach (var item in OSOptionPropertyList) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - OSOptionProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOSOptionProfileData(document.RootElement, options); - } - - internal static OSOptionProfileData DeserializeOSOptionProfileData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IReadOnlyList osOptionPropertyList = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("osOptionPropertyList"u8)) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ContainerServiceOSOptionProperty.DeserializeContainerServiceOSOptionProperty(item, options)); - } - osOptionPropertyList = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new OSOptionProfileData( - id, - name, - type, - systemData, - osOptionPropertyList, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support writing '{options.Format}' format."); - } - } - - OSOptionProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOSOptionProfileData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs deleted file mode 100644 index 8613a9ee4410..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A class representing the OSOptionProfile data model. - /// The OS option profile. - /// - public partial class OSOptionProfileData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The list of OS options. - /// is null. - internal OSOptionProfileData(IEnumerable osOptionPropertyList) - { - Argument.AssertNotNull(osOptionPropertyList, nameof(osOptionPropertyList)); - - OSOptionPropertyList = osOptionPropertyList.ToList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of OS options. - /// Keeps track of any properties unknown to the library. - internal OSOptionProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList osOptionPropertyList, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - OSOptionPropertyList = osOptionPropertyList; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OSOptionProfileData() - { - } - - /// The list of OS options. - public IReadOnlyList OSOptionPropertyList { get; } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs deleted file mode 100644 index 506123d852f4..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class OSOptionProfileResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - OSOptionProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - OSOptionProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs deleted file mode 100644 index bd4c8e6a8bb9..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.ContainerService -{ - /// - /// A Class representing an OSOptionProfile along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetOSOptionProfileResource method. - /// Otherwise you can get one from its parent resource using the GetOSOptionProfile method. - /// - public partial class OSOptionProfileResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The location. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _osOptionProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _osOptionProfileManagedClustersRestClient; - private readonly OSOptionProfileData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/locations/osOptions"; - - /// Initializes a new instance of the class for mocking. - protected OSOptionProfileResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal OSOptionProfileResource(ArmClient client, OSOptionProfileData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal OSOptionProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _osOptionProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string osOptionProfileManagedClustersApiVersion); - _osOptionProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, osOptionProfileManagedClustersApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual OSOptionProfileData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets supported OS options in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default - /// - /// - /// Operation Id - /// ManagedClusters_GetOSOptions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - public virtual async Task> GetAsync(ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - using var scope = _osOptionProfileManagedClustersClientDiagnostics.CreateScope("OSOptionProfileResource.Get"); - scope.Start(); - try - { - var response = await _osOptionProfileManagedClustersRestClient.GetOSOptionsAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), resourceType, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new OSOptionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets supported OS options in the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default - /// - /// - /// Operation Id - /// ManagedClusters_GetOSOptions - /// - /// - /// Default Api Version - /// 2023-10-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - public virtual Response Get(ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - using var scope = _osOptionProfileManagedClustersClientDiagnostics.CreateScope("OSOptionProfileResource.Get"); - scope.Start(); - try - { - var response = _osOptionProfileManagedClustersRestClient.GetOSOptions(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), resourceType, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new OSOptionProfileResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetMembersRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetMembersRestOperations.cs new file mode 100644 index 000000000000..4c6b9ac44906 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetMembersRestOperations.cs @@ -0,0 +1,639 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService +{ + internal partial class FleetMembersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetMembersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public FleetMembersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FleetMember resources by Fleet. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetMemberListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FleetMember resources by Fleet. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetMemberListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a FleetMember. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetMemberData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetMemberData.DeserializeFleetMemberData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetMemberData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a FleetMember. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetMemberData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetMemberData.DeserializeFleetMemberData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetMemberData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a FleetMember. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a FleetMember. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberPatch patch, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberPatch patch, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a FleetMember. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, patch, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a FleetMember. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, FleetMemberPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, patch, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/members/", false); + uri.AppendPath(fleetMemberName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a FleetMember. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a FleetMember. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the Fleet member resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetMemberName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetMemberName, nameof(fleetMemberName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetMemberName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FleetMember resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetMemberListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FleetMember resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetMemberListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetMemberListResult.DeserializeFleetMemberListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs similarity index 59% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs index c3e920e855a7..5d588e6e704c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.ContainerService { - internal partial class TrustedAccessRoleBindingsRestOperations + internal partial class FleetUpdateStrategiesRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of TrustedAccessRoleBindingsRestOperations. + /// Initializes a new instance of FleetUpdateStrategiesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. /// server parameter. /// Api Version. /// or is null. - public TrustedAccessRoleBindingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public FleetUpdateStrategiesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,14 +44,14 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -62,9 +62,9 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -72,28 +72,28 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// List trusted access role bindings. - /// The ID of the target subscription. The value must be an UUID. + /// List FleetUpdateStrategy resources by Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - TrustedAccessRoleBindingListResult value = default; + FleetUpdateStrategyListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TrustedAccessRoleBindingListResult.DeserializeTrustedAccessRoleBindingListResult(document.RootElement); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -101,28 +101,28 @@ public async Task> ListAsync(string } } - /// List trusted access role bindings. - /// The ID of the target subscription. The value must be an UUID. + /// List FleetUpdateStrategy resources by Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - TrustedAccessRoleBindingListResult value = default; + FleetUpdateStrategyListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TrustedAccessRoleBindingListResult.DeserializeTrustedAccessRoleBindingListResult(document.RootElement); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -130,7 +130,7 @@ public Response List(string subscriptionId, } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -138,15 +138,15 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings/", false); - uri.AppendPath(trustedAccessRoleBindingName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -157,10 +157,10 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings/", false); - uri.AppendPath(trustedAccessRoleBindingName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -168,73 +168,73 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Get a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Get a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ContainerServiceTrustedAccessRoleBindingData value = default; + FleetUpdateStrategyData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement); + value = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerServiceTrustedAccessRoleBindingData)null, message.Response); + return Response.FromValue((FleetUpdateStrategyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Get a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ContainerServiceTrustedAccessRoleBindingData value = default; + FleetUpdateStrategyData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceTrustedAccessRoleBindingData.DeserializeContainerServiceTrustedAccessRoleBindingData(document.RootElement); + value = FleetUpdateStrategyData.DeserializeFleetUpdateStrategyData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerServiceTrustedAccessRoleBindingData)null, message.Response); + return Response.FromValue((FleetUpdateStrategyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch, string ifNoneMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -242,15 +242,15 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings/", false); - uri.AppendPath(trustedAccessRoleBindingName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch, string ifNoneMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -261,12 +261,20 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings/", false); - uri.AppendPath(trustedAccessRoleBindingName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -276,24 +284,26 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Create or update a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Create a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. - /// A trusted access role binding. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, data, ifMatch, ifNoneMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -305,24 +315,26 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } } - /// Create or update a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Create a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. - /// A trusted access role binding. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, ContainerServiceTrustedAccessRoleBindingData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, FleetUpdateStrategyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, data, ifMatch, ifNoneMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -334,7 +346,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -342,15 +354,15 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings/", false); - uri.AppendPath(trustedAccessRoleBindingName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -361,36 +373,42 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/trustedAccessRoleBindings/", false); - uri.AppendPath(trustedAccessRoleBindingName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateStrategies/", false); + uri.AppendPath(updateStrategyName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Delete a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: case 204: return message.Response; @@ -399,25 +417,27 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Delete a trusted access role binding. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a FleetUpdateStrategy. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of trusted access role binding. + /// The name of the Fleet resource. + /// The name of the UpdateStrategy resource. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string updateStrategyName, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(trustedAccessRoleBindingName, nameof(trustedAccessRoleBindingName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateStrategyName, nameof(updateStrategyName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, trustedAccessRoleBindingName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateStrategyName, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: case 204: return message.Response; @@ -426,7 +446,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -434,7 +454,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -448,30 +468,30 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// List trusted access role bindings. + /// List FleetUpdateStrategy resources by Fleet. /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - TrustedAccessRoleBindingListResult value = default; + FleetUpdateStrategyListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TrustedAccessRoleBindingListResult.DeserializeTrustedAccessRoleBindingListResult(document.RootElement); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -479,30 +499,30 @@ public async Task> ListNextPageAsyn } } - /// List trusted access role bindings. + /// List FleetUpdateStrategy resources by Fleet. /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - TrustedAccessRoleBindingListResult value = default; + FleetUpdateStrategyListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TrustedAccessRoleBindingListResult.DeserializeTrustedAccessRoleBindingListResult(document.RootElement); + value = FleetUpdateStrategyListResult.DeserializeFleetUpdateStrategyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetsRestOperations.cs similarity index 51% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetsRestOperations.cs index ed1c05c551de..90774a2630a1 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/FleetsRestOperations.cs @@ -15,60 +15,48 @@ namespace Azure.ResourceManager.ContainerService { - internal partial class AgentPoolsRestOperations + internal partial class FleetsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of AgentPoolsRestOperations. + /// Initializes a new instance of FleetsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. /// server parameter. /// Api Version. /// or is null. - public AgentPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public FleetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateAbortLatestOperationRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedclusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); - uri.AppendPath("/abort", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateAbortLatestOperationRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedclusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); - uri.AppendPath("/abort", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -76,61 +64,57 @@ internal HttpMessage CreateAbortLatestOperationRequest(string subscriptionId, st return message; } - /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// Lists fleets in the specified subscription. + /// The ID of the target subscription. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task AbortLatestOperationAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - using var message = CreateAbortLatestOperationRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 202: - case 204: - return message.Response; + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// Lists fleets in the specified subscription. + /// The ID of the target subscription. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response AbortLatestOperation(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - using var message = CreateAbortLatestOperationRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 202: - case 204: - return message.Response; + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -138,14 +122,12 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -156,9 +138,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -166,28 +146,26 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// Gets a list of agent pools in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Lists fleets in the specified subscription and resource group. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolListResult value = default; + FleetListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceAgentPoolListResult.DeserializeContainerServiceAgentPoolListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -195,28 +173,26 @@ public async Task> ListAsync(strin } } - /// Gets a list of agent pools in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Lists fleets in the specified subscription and resource group. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolListResult value = default; + FleetListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceAgentPoolListResult.DeserializeContainerServiceAgentPoolListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -224,7 +200,7 @@ public Response List(string subscriptionId, } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -232,15 +208,13 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -251,10 +225,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -262,73 +234,69 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets the specified managed cluster agent pool. - /// The ID of the target subscription. The value must be an UUID. + /// Gets a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// The name of the Fleet resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolData value = default; + FleetData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(document.RootElement); + value = FleetData.DeserializeFleetData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerServiceAgentPoolData)null, message.Response); + return Response.FromValue((FleetData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the specified managed cluster agent pool. - /// The ID of the target subscription. The value must be an UUID. + /// Gets a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// The name of the Fleet resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolData value = default; + FleetData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(document.RootElement); + value = FleetData.DeserializeFleetData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerServiceAgentPoolData)null, message.Response); + return Response.FromValue((FleetData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, string ifMatch, string ifNoneMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -336,15 +304,13 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, string ifMatch, string ifNoneMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -355,12 +321,18 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -370,24 +342,24 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Creates or updates an agent pool in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Creates or updates a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. - /// The agent pool to create or update. + /// The name of the Fleet resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data, ifMatch, ifNoneMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -399,24 +371,24 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } } - /// Creates or updates an agent pool in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Creates or updates a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. - /// The agent pool to create or update. + /// The name of the Fleet resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data, ifMatch, ifNoneMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -428,7 +400,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, string ifMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -436,91 +408,97 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Deletes an agent pool in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Update a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// The name of the Fleet resource. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Deletes an agent pool in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. + /// Update a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// The name of the Fleet resource. + /// The resource properties to be updated. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetUpgradeProfileRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string ifMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -528,105 +506,91 @@ internal RequestUriBuilder CreateGetUpgradeProfileRequestUri(string subscription uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); - uri.AppendPath("/upgradeProfiles/default", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetUpgradeProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); - uri.AppendPath("/upgradeProfiles/default", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Gets the upgrade profile for an agent pool. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// The name of the Fleet resource. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetUpgradeProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateGetUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - AgentPoolUpgradeProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolUpgradeProfileData.DeserializeAgentPoolUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AgentPoolUpgradeProfileData)null, message.Response); + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets the upgrade profile for an agent pool. - /// The ID of the target subscription. The value must be an UUID. + /// Delete a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// The name of the Fleet resource. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetUpgradeProfile(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateGetUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - AgentPoolUpgradeProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolUpgradeProfileData.DeserializeAgentPoolUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AgentPoolUpgradeProfileData)null, message.Response); + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetAvailableAgentPoolVersionsRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListCredentialsRequestUri(string subscriptionId, string resourceGroupName, string fleetName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -634,27 +598,27 @@ internal RequestUriBuilder CreateGetAvailableAgentPoolVersionsRequestUri(string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/availableAgentPoolVersions", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/listCredentials", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetAvailableAgentPoolVersionsRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListCredentialsRequest(string subscriptionId, string resourceGroupName, string fleetName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/availableAgentPoolVersions", false); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/listCredentials", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -662,28 +626,28 @@ internal HttpMessage CreateGetAvailableAgentPoolVersionsRequest(string subscript return message; } - /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. - /// The ID of the target subscription. The value must be an UUID. + /// Lists the user credentials of a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAvailableAgentPoolVersionsAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListCredentialsAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateGetAvailableAgentPoolVersionsRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListCredentialsRequest(subscriptionId, resourceGroupName, fleetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolAvailableVersions value = default; + FleetCredentialResults value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolAvailableVersions.DeserializeAgentPoolAvailableVersions(document.RootElement); + value = FleetCredentialResults.DeserializeFleetCredentialResults(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -691,28 +655,28 @@ public async Task> GetAvailableAgentPoolVer } } - /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. - /// The ID of the target subscription. The value must be an UUID. + /// Lists the user credentials of a Fleet. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// The name of the Fleet resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetAvailableAgentPoolVersions(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListCredentials(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); - using var message = CreateGetAvailableAgentPoolVersionsRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListCredentialsRequest(subscriptionId, resourceGroupName, fleetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolAvailableVersions value = default; + FleetCredentialResults value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolAvailableVersions.DeserializeAgentPoolAvailableVersions(document.RootElement); + value = FleetCredentialResults.DeserializeFleetCredentialResults(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -720,101 +684,83 @@ public Response GetAvailableAgentPoolVersions(string } } - internal RequestUriBuilder CreateUpgradeNodeImageVersionRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); - uri.AppendPath("/upgradeNodeImageVersion", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); return uri; } - internal HttpMessage CreateUpgradeNodeImageVersionRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/agentPools/", false); - uri.AppendPath(agentPoolName, true); - uri.AppendPath("/upgradeNodeImageVersion", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// Lists fleets in the specified subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpgradeNodeImageVersionAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - using var message = CreateUpgradeNodeImageVersionRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the agent pool. + /// Lists fleets in the specified subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response UpgradeNodeImageVersion(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - using var message = CreateUpgradeNodeImageVersionRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -822,7 +768,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -836,30 +782,28 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Gets a list of agent pools in the specified managed cluster. + /// Lists fleets in the specified subscription and resource group. /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolListResult value = default; + FleetListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceAgentPoolListResult.DeserializeContainerServiceAgentPoolListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -867,30 +811,28 @@ public async Task> ListNextPageAsy } } - /// Gets a list of agent pools in the specified managed cluster. + /// Lists fleets in the specified subscription and resource group. /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ContainerServiceAgentPoolListResult value = default; + FleetListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceAgentPoolListResult.DeserializeContainerServiceAgentPoolListResult(document.RootElement); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs deleted file mode 100644 index 2bde479507b1..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs +++ /dev/null @@ -1,523 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class MaintenanceConfigurationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of MaintenanceConfigurationsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public MaintenanceConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListByManagedClusterRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByManagedClusterRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of maintenance configurations in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByManagedClusterAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByManagedClusterRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceMaintenanceConfigurationListResult.DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of maintenance configurations in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByManagedCluster(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByManagedClusterRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceMaintenanceConfigurationListResult.DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string configName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations/", false); - uri.AppendPath(configName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string configName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations/", false); - uri.AppendPath(configName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the specified maintenance configuration of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, configName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServiceMaintenanceConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the specified maintenance configuration of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, configName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServiceMaintenanceConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string configName, ContainerServiceMaintenanceConfigurationData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations/", false); - uri.AppendPath(configName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string configName, ContainerServiceMaintenanceConfigurationData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations/", false); - uri.AppendPath(configName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the maintenance configuration. - /// The maintenance configuration to create or update. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, configName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - ContainerServiceMaintenanceConfigurationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates a maintenance configuration in the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the maintenance configuration. - /// The maintenance configuration to create or update. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, configName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - ContainerServiceMaintenanceConfigurationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string configName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations/", false); - uri.AppendPath(configName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string configName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/maintenanceConfigurations/", false); - uri.AppendPath(configName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a maintenance configuration. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, configName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a maintenance configuration. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the maintenance configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string configName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configName, nameof(configName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, configName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByManagedClusterNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByManagedClusterNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of maintenance configurations in the specified managed cluster. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByManagedClusterNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByManagedClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceMaintenanceConfigurationListResult.DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of maintenance configurations in the specified managed cluster. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByManagedClusterNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByManagedClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceMaintenanceConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceMaintenanceConfigurationListResult.DeserializeContainerServiceMaintenanceConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs deleted file mode 100644 index 503359a3f987..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs +++ /dev/null @@ -1,2957 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class ManagedClustersRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ManagedClustersRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ManagedClustersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetOSOptionsRequestUri(string subscriptionId, AzureLocation location, ResourceType? resourceType) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/osOptions/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (resourceType != null) - { - uri.AppendQuery("resource-type", resourceType.Value, true); - } - return uri; - } - - internal HttpMessage CreateGetOSOptionsRequest(string subscriptionId, AzureLocation location, ResourceType? resourceType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/osOptions/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (resourceType != null) - { - uri.AppendQuery("resource-type", resourceType.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets supported OS options in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetOSOptionsAsync(string subscriptionId, AzureLocation location, ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetOSOptionsRequest(subscriptionId, location, resourceType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OSOptionProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OSOptionProfileData.DeserializeOSOptionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((OSOptionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets supported OS options in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response GetOSOptions(string subscriptionId, AzureLocation location, ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetOSOptionsRequest(subscriptionId, location, resourceType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OSOptionProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OSOptionProfileData.DeserializeOSOptionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((OSOptionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListKubernetesVersionsRequestUri(string subscriptionId, AzureLocation location) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/kubernetesVersions", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListKubernetesVersionsRequest(string subscriptionId, AzureLocation location) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/kubernetesVersions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListKubernetesVersionsAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListKubernetesVersionsRequest(subscriptionId, location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - KubernetesVersionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = KubernetesVersionListResult.DeserializeKubernetesVersionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListKubernetesVersions(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListKubernetesVersionsRequest(subscriptionId, location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - KubernetesVersionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = KubernetesVersionListResult.DeserializeKubernetesVersionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of managed clusters in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of managed clusters in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists managed clusters in the specified subscription and resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists managed clusters in the specified subscription and resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetUpgradeProfileRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/upgradeProfiles/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetUpgradeProfileRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/upgradeProfiles/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the upgrade profile of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetUpgradeProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterUpgradeProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterUpgradeProfileData.DeserializeManagedClusterUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ManagedClusterUpgradeProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the upgrade profile of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetUpgradeProfile(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterUpgradeProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterUpgradeProfileData.DeserializeManagedClusterUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ManagedClusterUpgradeProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetAccessProfileRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string roleName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/accessProfiles/", false); - uri.AppendPath(roleName, true); - uri.AppendPath("/listCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetAccessProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, string roleName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/accessProfiles/", false); - uri.AppendPath(roleName, true); - uri.AppendPath("/listCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the role for managed cluster accessProfile resource. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAccessProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, string roleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(roleName, nameof(roleName)); - - using var message = CreateGetAccessProfileRequest(subscriptionId, resourceGroupName, resourceName, roleName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterAccessProfile value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterAccessProfile.DeserializeManagedClusterAccessProfile(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the role for managed cluster accessProfile resource. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetAccessProfile(string subscriptionId, string resourceGroupName, string resourceName, string roleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(roleName, nameof(roleName)); - - using var message = CreateGetAccessProfileRequest(subscriptionId, resourceGroupName, resourceName, roleName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterAccessProfile value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterAccessProfile.DeserializeManagedClusterAccessProfile(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListClusterAdminCredentialsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/listClusterAdminCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (serverFqdn != null) - { - uri.AppendQuery("server-fqdn", serverFqdn, true); - } - return uri; - } - - internal HttpMessage CreateListClusterAdminCredentialsRequest(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/listClusterAdminCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (serverFqdn != null) - { - uri.AppendQuery("server-fqdn", serverFqdn, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the admin credentials of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListClusterAdminCredentialsAsync(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterAdminCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the admin credentials of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListClusterAdminCredentials(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterAdminCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListClusterUserCredentialsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn, KubeConfigFormat? format) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/listClusterUserCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (serverFqdn != null) - { - uri.AppendQuery("server-fqdn", serverFqdn, true); - } - if (format != null) - { - uri.AppendQuery("format", format.Value.ToString(), true); - } - return uri; - } - - internal HttpMessage CreateListClusterUserCredentialsRequest(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn, KubeConfigFormat? format) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/listClusterUserCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (serverFqdn != null) - { - uri.AppendQuery("server-fqdn", serverFqdn, true); - } - if (format != null) - { - uri.AppendQuery("format", format.Value.ToString(), true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the user credentials of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// server fqdn type for credentials to be returned. - /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListClusterUserCredentialsAsync(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, KubeConfigFormat? format = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterUserCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn, format); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the user credentials of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// server fqdn type for credentials to be returned. - /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListClusterUserCredentials(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, KubeConfigFormat? format = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterUserCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn, format); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListClusterMonitoringUserCredentialsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/listClusterMonitoringUserCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (serverFqdn != null) - { - uri.AppendQuery("server-fqdn", serverFqdn, true); - } - return uri; - } - - internal HttpMessage CreateListClusterMonitoringUserCredentialsRequest(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/listClusterMonitoringUserCredential", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (serverFqdn != null) - { - uri.AppendQuery("server-fqdn", serverFqdn, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the cluster monitoring user credentials of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListClusterMonitoringUserCredentialsAsync(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterMonitoringUserCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the cluster monitoring user credentials of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// server fqdn type for credentials to be returned. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListClusterMonitoringUserCredentials(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListClusterMonitoringUserCredentialsRequest(subscriptionId, resourceGroupName, resourceName, serverFqdn); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterCredentials value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterCredentials.DeserializeManagedClusterCredentials(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceManagedClusterData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServiceManagedClusterData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServiceManagedClusterData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServiceManagedClusterData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The managed cluster to create or update. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The managed cluster to create or update. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(containerServiceTagsObject, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates tags on a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Parameters supplied to the Update Managed Cluster Tags operation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateTagsAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates tags on a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Parameters supplied to the Update Managed Cluster Tags operation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateTags(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateResetServicePrincipalProfileRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/resetServicePrincipalProfile", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateResetServicePrincipalProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/resetServicePrincipalProfile", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(managedClusterServicePrincipalProfile, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// This action cannot be performed on a cluster that is not using a service principal. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The service principal profile to set on the managed cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task ResetServicePrincipalProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(managedClusterServicePrincipalProfile, nameof(managedClusterServicePrincipalProfile)); - - using var message = CreateResetServicePrincipalProfileRequest(subscriptionId, resourceGroupName, resourceName, managedClusterServicePrincipalProfile); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// This action cannot be performed on a cluster that is not using a service principal. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The service principal profile to set on the managed cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ResetServicePrincipalProfile(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterServicePrincipalProfile managedClusterServicePrincipalProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(managedClusterServicePrincipalProfile, nameof(managedClusterServicePrincipalProfile)); - - using var message = CreateResetServicePrincipalProfileRequest(subscriptionId, resourceGroupName, resourceName, managedClusterServicePrincipalProfile); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateResetAadProfileRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterAadProfile managedClusterAadProfile) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/resetAADProfile", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateResetAadProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterAadProfile managedClusterAadProfile) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/resetAADProfile", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(managedClusterAadProfile, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The AAD profile to set on the Managed Cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task ResetAadProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterAadProfile managedClusterAadProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(managedClusterAadProfile, nameof(managedClusterAadProfile)); - - using var message = CreateResetAadProfileRequest(subscriptionId, resourceGroupName, resourceName, managedClusterAadProfile); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The AAD profile to set on the Managed Cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ResetAadProfile(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterAadProfile managedClusterAadProfile, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(managedClusterAadProfile, nameof(managedClusterAadProfile)); - - using var message = CreateResetAadProfileRequest(subscriptionId, resourceGroupName, resourceName, managedClusterAadProfile); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateRotateClusterCertificatesRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/rotateClusterCertificates", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateRotateClusterCertificatesRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/rotateClusterCertificates", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task RotateClusterCertificatesAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateRotateClusterCertificatesRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response RotateClusterCertificates(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateRotateClusterCertificatesRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateAbortLatestOperationRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedclusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/abort", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateAbortLatestOperationRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedclusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/abort", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task AbortLatestOperationAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateAbortLatestOperationRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response AbortLatestOperation(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateAbortLatestOperationRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateRotateServiceAccountSigningKeysRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/rotateServiceAccountSigningKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateRotateServiceAccountSigningKeysRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/rotateServiceAccountSigningKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Rotates the service account signing keys of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task RotateServiceAccountSigningKeysAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateRotateServiceAccountSigningKeysRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Rotates the service account signing keys of a managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response RotateServiceAccountSigningKeys(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateRotateServiceAccountSigningKeysRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/stop", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/stop", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task StopAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateStopRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Stop(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateStopRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/start", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/start", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task StartAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateStartRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Start(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateStartRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateRunCommandRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterRunCommandContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/runCommand", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateRunCommandRequest(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterRunCommandContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/runCommand", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The run command request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task RunCommandAsync(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterRunCommandContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRunCommandRequest(subscriptionId, resourceGroupName, resourceName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The run command request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response RunCommand(string subscriptionId, string resourceGroupName, string resourceName, ManagedClusterRunCommandContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRunCommandRequest(subscriptionId, resourceGroupName, resourceName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCommandResultRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string commandId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/commandResults/", false); - uri.AppendPath(commandId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetCommandResultRequest(string subscriptionId, string resourceGroupName, string resourceName, string commandId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/commandResults/", false); - uri.AppendPath(commandId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the results of a command which has been run on the Managed Cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Id of the command. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetCommandResultAsync(string subscriptionId, string resourceGroupName, string resourceName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandResultRequest(subscriptionId, resourceGroupName, resourceName, commandId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterRunCommandResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterRunCommandResult.DeserializeManagedClusterRunCommandResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 202: - return Response.FromValue((ManagedClusterRunCommandResult)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the results of a command which has been run on the Managed Cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Id of the command. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetCommandResult(string subscriptionId, string resourceGroupName, string resourceName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandResultRequest(subscriptionId, resourceGroupName, resourceName, commandId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterRunCommandResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterRunCommandResult.DeserializeManagedClusterRunCommandResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 202: - return Response.FromValue((ManagedClusterRunCommandResult)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListOutboundNetworkDependenciesEndpointsRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/outboundNetworkDependenciesEndpoints", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/outboundNetworkDependenciesEndpoints", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListOutboundNetworkDependenciesEndpointsAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListOutboundNetworkDependenciesEndpointsRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OutboundEnvironmentEndpointListResult.DeserializeOutboundEnvironmentEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListOutboundNetworkDependenciesEndpoints(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListOutboundNetworkDependenciesEndpointsRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OutboundEnvironmentEndpointListResult.DeserializeOutboundEnvironmentEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListMeshRevisionProfilesRequestUri(string subscriptionId, AzureLocation location) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/meshRevisionProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListMeshRevisionProfilesRequest(string subscriptionId, AzureLocation location) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/meshRevisionProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListMeshRevisionProfilesAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListMeshRevisionProfilesRequest(subscriptionId, location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshRevisionProfileList.DeserializeMeshRevisionProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListMeshRevisionProfiles(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListMeshRevisionProfilesRequest(subscriptionId, location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshRevisionProfileList.DeserializeMeshRevisionProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetMeshRevisionProfileRequestUri(string subscriptionId, AzureLocation location, string mode) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/meshRevisionProfiles/", false); - uri.AppendPath(mode, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetMeshRevisionProfileRequest(string subscriptionId, AzureLocation location, string mode) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/meshRevisionProfiles/", false); - uri.AppendPath(mode, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetMeshRevisionProfileAsync(string subscriptionId, AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var message = CreateGetMeshRevisionProfileRequest(subscriptionId, location, mode); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshRevisionProfileData.DeserializeMeshRevisionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MeshRevisionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The mode of the mesh. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response GetMeshRevisionProfile(string subscriptionId, AzureLocation location, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var message = CreateGetMeshRevisionProfileRequest(subscriptionId, location, mode); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshRevisionProfileData.DeserializeMeshRevisionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MeshRevisionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListMeshUpgradeProfilesRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/meshUpgradeProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListMeshUpgradeProfilesRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/meshUpgradeProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists available upgrades for all service meshes in a specific cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListMeshUpgradeProfilesAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListMeshUpgradeProfilesRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshUpgradeProfileList.DeserializeMeshUpgradeProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists available upgrades for all service meshes in a specific cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListMeshUpgradeProfiles(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListMeshUpgradeProfilesRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshUpgradeProfileList.DeserializeMeshUpgradeProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetMeshUpgradeProfileRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string mode) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/meshUpgradeProfiles/", false); - uri.AppendPath(mode, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetMeshUpgradeProfileRequest(string subscriptionId, string resourceGroupName, string resourceName, string mode) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/meshUpgradeProfiles/", false); - uri.AppendPath(mode, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets available upgrades for a service mesh in a cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The mode of the mesh. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetMeshUpgradeProfileAsync(string subscriptionId, string resourceGroupName, string resourceName, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var message = CreateGetMeshUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName, mode); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MeshUpgradeProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets available upgrades for a service mesh in a cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The mode of the mesh. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetMeshUpgradeProfile(string subscriptionId, string resourceGroupName, string resourceName, string mode, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(mode, nameof(mode)); - - using var message = CreateGetMeshUpgradeProfileRequest(subscriptionId, resourceGroupName, resourceName, mode); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshUpgradeProfileData.DeserializeMeshUpgradeProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MeshUpgradeProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of managed clusters in the specified subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of managed clusters in the specified subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists managed clusters in the specified subscription and resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists managed clusters in the specified subscription and resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ManagedClusterListResult.DeserializeManagedClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListOutboundNetworkDependenciesEndpointsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListOutboundNetworkDependenciesEndpointsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OutboundEnvironmentEndpointListResult.DeserializeOutboundEnvironmentEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListOutboundNetworkDependenciesEndpointsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OutboundEnvironmentEndpointListResult.DeserializeOutboundEnvironmentEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListMeshRevisionProfilesNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListMeshRevisionProfilesNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListMeshRevisionProfilesNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListMeshRevisionProfilesNextPageRequest(nextLink, subscriptionId, location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshRevisionProfileList.DeserializeMeshRevisionProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListMeshRevisionProfilesNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListMeshRevisionProfilesNextPageRequest(nextLink, subscriptionId, location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshRevisionProfileList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshRevisionProfileList.DeserializeMeshRevisionProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListMeshUpgradeProfilesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListMeshUpgradeProfilesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists available upgrades for all service meshes in a specific cluster. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListMeshUpgradeProfilesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListMeshUpgradeProfilesNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MeshUpgradeProfileList.DeserializeMeshUpgradeProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists available upgrades for all service meshes in a specific cluster. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListMeshUpgradeProfilesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListMeshUpgradeProfilesNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MeshUpgradeProfileList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MeshUpgradeProfileList.DeserializeMeshUpgradeProfileList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs deleted file mode 100644 index 856fc34d8ad9..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class PrivateEndpointConnectionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of PrivateEndpointConnectionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateEndpointConnectionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateEndpointConnectionListResult.DeserializeContainerServicePrivateEndpointConnectionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateEndpointConnectionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateEndpointConnectionListResult.DeserializeContainerServicePrivateEndpointConnectionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateEndpointConnectionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServicePrivateEndpointConnectionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateEndpointConnectionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerServicePrivateEndpointConnectionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the private endpoint connection. - /// The updated private endpoint connection. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - ContainerServicePrivateEndpointConnectionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the private endpoint connection. - /// The updated private endpoint connection. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, ContainerServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - ContainerServicePrivateEndpointConnectionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateEndpointConnectionData.DeserializeContainerServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs deleted file mode 100644 index 49dbd76496a9..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class PrivateLinkResourcesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of PrivateLinkResourcesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateLinkResourcesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateLinkResourcesListResult.DeserializeContainerServicePrivateLinkResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateLinkResourcesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateLinkResourcesListResult.DeserializeContainerServicePrivateLinkResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs deleted file mode 100644 index 079e3871afa5..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; - -namespace Azure.ResourceManager.ContainerService -{ - internal partial class ResolvePrivateLinkServiceIdRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ResolvePrivateLinkServiceIdRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ResolvePrivateLinkServiceIdRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServicePrivateLinkResourceData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/resolvePrivateLinkServiceId", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreatePostRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServicePrivateLinkResourceData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/resolvePrivateLinkServiceId", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Gets the private link service ID for the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Parameters required in order to resolve a private link service ID. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> PostAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServicePrivateLinkResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreatePostRequest(subscriptionId, resourceGroupName, resourceName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateLinkResourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the private link service ID for the specified managed cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Parameters required in order to resolve a private link service ID. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Post(string subscriptionId, string resourceGroupName, string resourceName, ContainerServicePrivateLinkResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreatePostRequest(subscriptionId, resourceGroupName, resourceName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerServicePrivateLinkResourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerServicePrivateLinkResourceData.DeserializeContainerServicePrivateLinkResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/UpdateRunsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/UpdateRunsRestOperations.cs new file mode 100644 index 000000000000..09176bf34cc6 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/UpdateRunsRestOperations.cs @@ -0,0 +1,841 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService +{ + internal partial class UpdateRunsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of UpdateRunsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public UpdateRunsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List UpdateRun resources by Fleet. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UpdateRunListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List UpdateRun resources by Fleet. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UpdateRunListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateRunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UpdateRunData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = UpdateRunData.DeserializeUpdateRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((UpdateRunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, updateRunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UpdateRunData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = UpdateRunData.DeserializeUpdateRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((UpdateRunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, UpdateRunData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, UpdateRunData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateSkipRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/skip", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateSkipRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/skip", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task SkipAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateSkipRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, body, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Skip(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateSkipRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, body, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Starts an UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts an UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Stops an UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops an UpdateRun. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List UpdateRun resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UpdateRunListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List UpdateRun resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UpdateRunListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = UpdateRunListResult.DeserializeUpdateRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunCollection.cs new file mode 100644 index 000000000000..0b90a3049757 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetUpdateRuns method from an instance of . + /// + public partial class UpdateRunCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _updateRunClientDiagnostics; + private readonly UpdateRunsRestOperations _updateRunRestClient; + + /// Initializes a new instance of the class for mocking. + protected UpdateRunCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal UpdateRunCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _updateRunClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", UpdateRunResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(UpdateRunResource.ResourceType, out string updateRunApiVersion); + _updateRunRestClient = new UpdateRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, updateRunApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Create a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateRun resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string updateRunName, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _updateRunRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the UpdateRun resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string updateRunName, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _updateRunRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.Get"); + scope.Start(); + try + { + var response = await _updateRunRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.Get"); + scope.Start(); + try + { + var response = _updateRunRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List UpdateRun resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns + /// + /// + /// Operation Id + /// UpdateRuns_ListByFleet + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _updateRunRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _updateRunRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new UpdateRunResource(Client, UpdateRunData.DeserializeUpdateRunData(e)), _updateRunClientDiagnostics, Pipeline, "UpdateRunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List UpdateRun resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns + /// + /// + /// Operation Id + /// UpdateRuns_ListByFleet + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _updateRunRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _updateRunRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new UpdateRunResource(Client, UpdateRunData.DeserializeUpdateRunData(e)), _updateRunClientDiagnostics, Pipeline, "UpdateRunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.Exists"); + scope.Start(); + try + { + var response = await _updateRunRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.Exists"); + scope.Start(); + try + { + var response = _updateRunRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _updateRunRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the UpdateRun resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string updateRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunCollection.GetIfExists"); + scope.Start(); + try + { + var response = _updateRunRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.Serialization.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.Serialization.cs index 146b1718fff9..f65a24516fa9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.Serialization.cs @@ -15,19 +15,24 @@ namespace Azure.ResourceManager.ContainerService { - public partial class ContainerServiceMaintenanceConfigurationData : IUtf8JsonSerializable, IJsonModel + public partial class UpdateRunData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunData)} does not support writing '{format}' format."); } writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (options.Format != "W") { writer.WritePropertyName("id"u8); @@ -50,30 +55,30 @@ void IJsonModel.Write(Utf8JsonWrit } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsCollectionDefined(TimesInWeek)) + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { - writer.WritePropertyName("timeInWeek"u8); - writer.WriteStartArray(); - foreach (var item in TimesInWeek) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (Optional.IsCollectionDefined(NotAllowedTimes)) + if (Optional.IsDefined(UpdateStrategyId)) { - writer.WritePropertyName("notAllowedTime"u8); - writer.WriteStartArray(); - foreach (var item in NotAllowedTimes) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("updateStrategyId"u8); + writer.WriteStringValue(UpdateStrategyId); + } + if (Optional.IsDefined(Strategy)) + { + writer.WritePropertyName("strategy"u8); + writer.WriteObjectValue(Strategy, options); + } + if (Optional.IsDefined(ManagedClusterUpdate)) + { + writer.WritePropertyName("managedClusterUpdate"u8); + writer.WriteObjectValue(ManagedClusterUpdate, options); } - if (Optional.IsDefined(MaintenanceWindow)) + if (options.Format != "W" && Optional.IsDefined(Status)) { - writer.WritePropertyName("maintenanceWindow"u8); - writer.WriteObjectValue(MaintenanceWindow, options); + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -94,19 +99,19 @@ void IJsonModel.Write(Utf8JsonWrit writer.WriteEndObject(); } - ContainerServiceMaintenanceConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UpdateRunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(UpdateRunData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement, options); + return DeserializeUpdateRunData(document.RootElement, options); } - internal static ContainerServiceMaintenanceConfigurationData DeserializeContainerServiceMaintenanceConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) + internal static UpdateRunData DeserializeUpdateRunData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -114,17 +119,29 @@ internal static ContainerServiceMaintenanceConfigurationData DeserializeContaine { return null; } + ETag? etag = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - IList timeInWeek = default; - IList notAllowedTime = default; - ContainerServiceMaintenanceWindow maintenanceWindow = default; + UpdateRunProvisioningState? provisioningState = default; + ResourceIdentifier updateStrategyId = default; + UpdateRunStrategy strategy = default; + ManagedClusterUpdate managedClusterUpdate = default; + UpdateRunStatus status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -158,41 +175,49 @@ internal static ContainerServiceMaintenanceConfigurationData DeserializeContaine } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("timeInWeek"u8)) + if (property0.NameEquals("provisioningState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) + provisioningState = new UpdateRunProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("updateStrategyId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) { - array.Add(ContainerServiceTimeInWeek.DeserializeContainerServiceTimeInWeek(item, options)); + continue; } - timeInWeek = array; + updateStrategyId = new ResourceIdentifier(property0.Value.GetString()); continue; } - if (property0.NameEquals("notAllowedTime"u8)) + if (property0.NameEquals("strategy"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) + strategy = UpdateRunStrategy.DeserializeUpdateRunStrategy(property0.Value, options); + continue; + } + if (property0.NameEquals("managedClusterUpdate"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) { - array.Add(ContainerServiceTimeSpan.DeserializeContainerServiceTimeSpan(item, options)); + continue; } - notAllowedTime = array; + managedClusterUpdate = ManagedClusterUpdate.DeserializeManagedClusterUpdate(property0.Value, options); continue; } - if (property0.NameEquals("maintenanceWindow"u8)) + if (property0.NameEquals("status"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - maintenanceWindow = ContainerServiceMaintenanceWindow.DeserializeContainerServiceMaintenanceWindow(property0.Value, options); + status = UpdateRunStatus.DeserializeUpdateRunStatus(property0.Value, options); continue; } } @@ -204,46 +229,49 @@ internal static ContainerServiceMaintenanceConfigurationData DeserializeContaine } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceMaintenanceConfigurationData( + return new UpdateRunData( id, name, type, systemData, - timeInWeek ?? new ChangeTrackingList(), - notAllowedTime ?? new ChangeTrackingList(), - maintenanceWindow, + etag, + provisioningState, + updateStrategyId, + strategy, + managedClusterUpdate, + status, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunData)} does not support writing '{options.Format}' format."); } } - ContainerServiceMaintenanceConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + UpdateRunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceMaintenanceConfigurationData(document.RootElement, options); + return DeserializeUpdateRunData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceMaintenanceConfigurationData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(UpdateRunData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.cs new file mode 100644 index 000000000000..c2ef30251c9a --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunData.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing the UpdateRun data model. + /// A multi-stage process to perform update operations across members of a Fleet. + /// + public partial class UpdateRunData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public UpdateRunData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// The provisioning state of the UpdateRun resource. + /// + /// The resource id of the FleetUpdateStrategy resource to reference. + /// + /// When creating a new run, there are three ways to define a strategy for the run: + /// 1. Define a new strategy in place: Set the "strategy" field. + /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + /// + /// Setting both "updateStrategyId" and "strategy" is invalid. + /// + /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + /// + /// + /// The strategy defines the order in which the clusters will be updated. + /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. + /// The strategy of the UpdateRun can be modified until the run is started. + /// + /// The update to be applied to all clusters in the UpdateRun. The managedClusterUpdate can be modified until the run is started. + /// The status of the UpdateRun. + /// Keeps track of any properties unknown to the library. + internal UpdateRunData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? etag, UpdateRunProvisioningState? provisioningState, ResourceIdentifier updateStrategyId, UpdateRunStrategy strategy, ManagedClusterUpdate managedClusterUpdate, UpdateRunStatus status, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ETag = etag; + ProvisioningState = provisioningState; + UpdateStrategyId = updateStrategyId; + Strategy = strategy; + ManagedClusterUpdate = managedClusterUpdate; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + public ETag? ETag { get; } + /// The provisioning state of the UpdateRun resource. + public UpdateRunProvisioningState? ProvisioningState { get; } + /// + /// The resource id of the FleetUpdateStrategy resource to reference. + /// + /// When creating a new run, there are three ways to define a strategy for the run: + /// 1. Define a new strategy in place: Set the "strategy" field. + /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + /// + /// Setting both "updateStrategyId" and "strategy" is invalid. + /// + /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + /// + public ResourceIdentifier UpdateStrategyId { get; set; } + /// + /// The strategy defines the order in which the clusters will be updated. + /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. + /// The strategy of the UpdateRun can be modified until the run is started. + /// + internal UpdateRunStrategy Strategy { get; set; } + /// The list of stages that compose this update run. Min size: 1. + public IList StrategyStages + { + get => Strategy is null ? default : Strategy.Stages; + set => Strategy = new UpdateRunStrategy(value); + } + + /// The update to be applied to all clusters in the UpdateRun. The managedClusterUpdate can be modified until the run is started. + public ManagedClusterUpdate ManagedClusterUpdate { get; set; } + /// The status of the UpdateRun. + public UpdateRunStatus Status { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.Serialization.cs new file mode 100644 index 000000000000..78c846f8a361 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerService +{ + public partial class UpdateRunResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + UpdateRunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + UpdateRunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.cs new file mode 100644 index 000000000000..7b8e988cad9d --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/UpdateRunResource.cs @@ -0,0 +1,620 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A Class representing an UpdateRun along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetUpdateRunResource method. + /// Otherwise you can get one from its parent resource using the GetUpdateRun method. + /// + public partial class UpdateRunResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The updateRunName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _updateRunClientDiagnostics; + private readonly UpdateRunsRestOperations _updateRunRestClient; + private readonly UpdateRunData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/updateRuns"; + + /// Initializes a new instance of the class for mocking. + protected UpdateRunResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal UpdateRunResource(ArmClient client, UpdateRunData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal UpdateRunResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _updateRunClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string updateRunApiVersion); + _updateRunRestClient = new UpdateRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, updateRunApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual UpdateRunData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Get"); + scope.Start(); + try + { + var response = await _updateRunRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Get"); + scope.Start(); + try + { + var response = _updateRunRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UpdateRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Delete + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Delete"); + scope.Start(); + try + { + var response = await _updateRunRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_Delete + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Delete"); + scope.Start(); + try + { + var response = _updateRunRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Update"); + scope.Start(); + try + { + var response = await _updateRunRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a UpdateRun + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName} + /// + /// + /// Operation Id + /// UpdateRuns_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, UpdateRunData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Update"); + scope.Start(); + try + { + var response = _updateRunRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/skip + /// + /// + /// Operation Id + /// UpdateRuns_Skip + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> SkipAsync(WaitUntil waitUntil, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Skip"); + scope.Start(); + try + { + var response = await _updateRunRestClient.SkipAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateSkipRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/skip + /// + /// + /// Operation Id + /// UpdateRuns_Skip + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Skip(WaitUntil waitUntil, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Skip"); + scope.Start(); + try + { + var response = _updateRunRestClient.Skip(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateSkipRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts an UpdateRun. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/start + /// + /// + /// Operation Id + /// UpdateRuns_Start + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Start"); + scope.Start(); + try + { + var response = await _updateRunRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts an UpdateRun. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/start + /// + /// + /// Operation Id + /// UpdateRuns_Start + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Start"); + scope.Start(); + try + { + var response = _updateRunRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops an UpdateRun. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/stop + /// + /// + /// Operation Id + /// UpdateRuns_Stop + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Stop"); + scope.Start(); + try + { + var response = await _updateRunRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops an UpdateRun. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/stop + /// + /// + /// Operation Id + /// UpdateRuns_Stop + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _updateRunClientDiagnostics.CreateScope("UpdateRunResource.Stop"); + scope.Start(); + try + { + var response = _updateRunRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new UpdateRunOperationSource(Client), _updateRunClientDiagnostics, Pipeline, _updateRunRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md index 26f40157fee1..a99e5f01b122 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: ContainerService namespace: Azure.ResourceManager.ContainerService -require: https://github.com/Azure/azure-rest-api-specs/blob/8e674dd2a88ae73868c6fa7593a0ba4371e45991/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md #tag: package-2023-10 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/Azure.ResourceManager.Contoso.sln b/sdk/contoso/Azure.ResourceManager.Contoso/Azure.ResourceManager.Contoso.sln new file mode 100644 index 000000000000..e101973e4a92 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/Azure.ResourceManager.Contoso.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Contoso", "src\Azure.ResourceManager.Contoso.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Contoso.Tests", "tests\Azure.ResourceManager.Contoso.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/CHANGELOG.md b/sdk/contoso/Azure.ResourceManager.Contoso/CHANGELOG.md new file mode 100644 index 000000000000..13dd08af78ab --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/Directory.Build.props b/sdk/contoso/Azure.ResourceManager.Contoso/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/README.md b/sdk/contoso/Azure.ResourceManager.Contoso/README.md new file mode 100644 index 000000000000..66daccdec8ae --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/README.md @@ -0,0 +1,86 @@ +# Azure.ResourceManager.Contoso client library for .NET + +Azure.ResourceManager.Contoso is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/contoso/Azure.ResourceManager.Contoso/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.ResourceManager.Contoso --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/contoso/Azure.ResourceManager.Contoso/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/contoso/Azure.ResourceManager.Contoso/README.png) diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Azure.ResourceManager.Contoso.csproj b/sdk/contoso/Azure.ResourceManager.Contoso/src/Azure.ResourceManager.Contoso.csproj new file mode 100644 index 000000000000..560614ee1a30 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Azure.ResourceManager.Contoso.csproj @@ -0,0 +1,10 @@ + + + This is the Azure.ResourceManager.Contoso client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.ResourceManager.Contoso for Azure Data Plane + 1.0.0-beta.1 + Azure.ResourceManager.Contoso + $(RequiredTargetFrameworks) + true + + diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/ArmContosoModelFactory.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/ArmContosoModelFactory.cs new file mode 100644 index 000000000000..1a494dcad96f --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/ArmContosoModelFactory.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Contoso.Models +{ + /// Model factory for models. + public static partial class ArmContosoModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static EmployeeData EmployeeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, EmployeeProperties properties = null) + { + tags ??= new Dictionary(); + + return new EmployeeData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Age of employee. + /// City of employee. + /// Profile of employee. + /// The status of the last operation. + /// A new instance for mocking. + public static EmployeeProperties EmployeeProperties(int? age = null, string city = null, byte[] profile = null, ProvisioningState? provisioningState = null) + { + return new EmployeeProperties(age, city, profile, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. + /// Localized display information for this particular operation. + /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". + /// Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + /// A new instance for mocking. + public static Operation Operation(string name = null, bool? isDataAction = null, OperationDisplay display = null, Origin? origin = null, ActionType? actionType = null) + { + return new Operation( + name, + isDataAction, + display, + origin, + actionType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. + /// A new instance for mocking. + public static OperationDisplay OperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) + { + return new OperationDisplay(provider, resource, operation, description, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeCollection.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeCollection.cs new file mode 100644 index 000000000000..9ea08826ce22 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Contoso +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetEmployees method from an instance of . + /// + public partial class EmployeeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _employeeClientDiagnostics; + private readonly EmployeesRestOperations _employeeRestClient; + + /// Initializes a new instance of the class for mocking. + protected EmployeeCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal EmployeeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _employeeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Contoso", EmployeeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EmployeeResource.ResourceType, out string employeeApiVersion); + _employeeRestClient = new EmployeesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, employeeApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a Employee + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Employee. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string employeeName, EmployeeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _employeeRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, employeeName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContosoArmOperation(new EmployeeOperationSource(Client), _employeeClientDiagnostics, Pipeline, _employeeRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, employeeName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Employee + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Employee. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string employeeName, EmployeeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _employeeRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, employeeName, data, cancellationToken); + var operation = new ContosoArmOperation(new EmployeeOperationSource(Client), _employeeClientDiagnostics, Pipeline, _employeeRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, employeeName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Employee + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Employee. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string employeeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeCollection.Get"); + scope.Start(); + try + { + var response = await _employeeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, employeeName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EmployeeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Employee + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Employee. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string employeeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeCollection.Get"); + scope.Start(); + try + { + var response = _employeeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, employeeName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EmployeeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Employee resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees + /// + /// + /// Operation Id + /// Employee_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _employeeRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _employeeRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EmployeeResource(Client, EmployeeData.DeserializeEmployeeData(e)), _employeeClientDiagnostics, Pipeline, "EmployeeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Employee resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees + /// + /// + /// Operation Id + /// Employee_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _employeeRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _employeeRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EmployeeResource(Client, EmployeeData.DeserializeEmployeeData(e)), _employeeClientDiagnostics, Pipeline, "EmployeeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Employee. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string employeeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeCollection.Exists"); + scope.Start(); + try + { + var response = await _employeeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, employeeName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Employee. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string employeeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeCollection.Exists"); + scope.Start(); + try + { + var response = _employeeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, employeeName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Employee. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string employeeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _employeeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, employeeName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EmployeeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Employee. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string employeeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeCollection.GetIfExists"); + scope.Start(); + try + { + var response = _employeeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, employeeName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EmployeeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.Serialization.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeData.Serialization.cs similarity index 68% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.Serialization.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeData.Serialization.cs index 90a46d8e80a3..654dc0a80bce 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.Serialization.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeData.Serialization.cs @@ -10,23 +10,29 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Contoso.Models; using Azure.ResourceManager.Models; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso { - public partial class ManagedClusterAccessProfile : IUtf8JsonSerializable, IJsonModel + public partial class EmployeeData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterAccessProfile)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EmployeeData)} does not support writing '{format}' format."); } writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -60,14 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("systemData"u8); JsonSerializer.Serialize(writer, SystemData); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(KubeConfig)) - { - writer.WritePropertyName("kubeConfig"u8); - writer.WriteBase64StringValue(KubeConfig, "D"); - } - writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -86,19 +84,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteEndObject(); } - ManagedClusterAccessProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EmployeeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterAccessProfile)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EmployeeData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterAccessProfile(document.RootElement, options); + return DeserializeEmployeeData(document.RootElement, options); } - internal static ManagedClusterAccessProfile DeserializeManagedClusterAccessProfile(JsonElement element, ModelReaderWriterOptions options = null) + internal static EmployeeData DeserializeEmployeeData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -106,17 +104,26 @@ internal static ManagedClusterAccessProfile DeserializeManagedClusterAccessProfi { return null; } + EmployeeProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - byte[] kubeConfig = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = EmployeeProperties.DeserializeEmployeeProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -160,73 +167,52 @@ internal static ManagedClusterAccessProfile DeserializeManagedClusterAccessProfi systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("kubeConfig"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - kubeConfig = property0.Value.GetBytesFromBase64("D"); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterAccessProfile( + return new EmployeeData( id, name, type, systemData, tags ?? new ChangeTrackingDictionary(), location, - kubeConfig, + properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ManagedClusterAccessProfile)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmployeeData)} does not support writing '{options.Format}' format."); } } - ManagedClusterAccessProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EmployeeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterAccessProfile(document.RootElement, options); + return DeserializeEmployeeData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterAccessProfile)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmployeeData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeData.cs similarity index 64% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeData.cs index 1ae4080acb64..081bdf1fe2c7 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAccessProfile.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeData.cs @@ -8,12 +8,16 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.Contoso.Models; using Azure.ResourceManager.Models; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso { - /// Managed cluster Access Profile. - public partial class ManagedClusterAccessProfile : TrackedResourceData + /// + /// A class representing the Employee data model. + /// Employee resource + /// + public partial class EmployeeData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -47,33 +51,33 @@ public partial class ManagedClusterAccessProfile : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. - public ManagedClusterAccessProfile(AzureLocation location) : base(location) + public EmployeeData(AzureLocation location) : base(location) { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The tags. /// The location. - /// Base64-encoded Kubernetes configuration file. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal ManagedClusterAccessProfile(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, byte[] kubeConfig, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal EmployeeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, EmployeeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - KubeConfig = kubeConfig; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ManagedClusterAccessProfile() + /// Initializes a new instance of for deserialization. + internal EmployeeData() { } - /// Base64-encoded Kubernetes configuration file. - public byte[] KubeConfig { get; set; } + /// The resource-specific properties for this resource. + public EmployeeProperties Properties { get; set; } } } diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeResource.Serialization.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeResource.Serialization.cs new file mode 100644 index 000000000000..9ba6d75f170e --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Contoso +{ + public partial class EmployeeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EmployeeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EmployeeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeResource.cs similarity index 61% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeResource.cs index 6045d3413e5b..3e4bb6bdc2fb 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/EmployeeResource.cs @@ -12,58 +12,58 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Contoso.Models; using Azure.ResourceManager.Resources; -namespace Azure.ResourceManager.ContainerService +namespace Azure.ResourceManager.Contoso { /// - /// A Class representing an AgentPoolSnapshot along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetAgentPoolSnapshotResource method. - /// Otherwise you can get one from its parent resource using the GetAgentPoolSnapshot method. + /// A Class representing an Employee along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetEmployeeResource method. + /// Otherwise you can get one from its parent resource using the GetEmployee method. /// - public partial class AgentPoolSnapshotResource : ArmResource + public partial class EmployeeResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The resourceName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName) + /// The employeeName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string employeeName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _agentPoolSnapshotSnapshotsClientDiagnostics; - private readonly SnapshotsRestOperations _agentPoolSnapshotSnapshotsRestClient; - private readonly AgentPoolSnapshotData _data; + private readonly ClientDiagnostics _employeeClientDiagnostics; + private readonly EmployeesRestOperations _employeeRestClient; + private readonly EmployeeData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/snapshots"; + public static readonly ResourceType ResourceType = "Microsoft.Contoso/employees"; - /// Initializes a new instance of the class for mocking. - protected AgentPoolSnapshotResource() + /// Initializes a new instance of the class for mocking. + protected EmployeeResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal AgentPoolSnapshotResource(ArmClient client, AgentPoolSnapshotData data) : this(client, data.Id) + internal EmployeeResource(ArmClient client, EmployeeData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal AgentPoolSnapshotResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal EmployeeResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _agentPoolSnapshotSnapshotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string agentPoolSnapshotSnapshotsApiVersion); - _agentPoolSnapshotSnapshotsRestClient = new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolSnapshotSnapshotsApiVersion); + _employeeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Contoso", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string employeeApiVersion); + _employeeRestClient = new EmployeesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, employeeApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +74,7 @@ internal AgentPoolSnapshotResource(ArmClient client, ResourceIdentifier id) : ba /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual AgentPoolSnapshotData Data + public virtual EmployeeData Data { get { @@ -91,37 +91,37 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets a snapshot. + /// Get a Employee /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Get + /// Employees_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Get"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.Get"); scope.Start(); try { - var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _employeeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new EmployeeResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -131,37 +131,37 @@ public virtual async Task> GetAsync(Cancella } /// - /// Gets a snapshot. + /// Get a Employee /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Get + /// Employees_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Get"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.Get"); scope.Start(); try { - var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _employeeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new EmployeeResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -171,23 +171,23 @@ public virtual Response Get(CancellationToken cancell } /// - /// Deletes a snapshot. + /// Delete a Employee /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Delete + /// Employees_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// @@ -195,14 +195,12 @@ public virtual Response Get(CancellationToken cancell /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Delete"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.Delete"); scope.Start(); try { - var response = await _agentPoolSnapshotSnapshotsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _agentPoolSnapshotSnapshotsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(response, rehydrationToken); + var response = await _employeeRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContosoArmOperation(_employeeClientDiagnostics, Pipeline, _employeeRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -215,23 +213,23 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes a snapshot. + /// Delete a Employee /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Delete + /// Employees_Delete /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// @@ -239,14 +237,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Delete"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.Delete"); scope.Start(); try { - var response = _agentPoolSnapshotSnapshotsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var uri = _agentPoolSnapshotSnapshotsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerServiceArmOperation(response, rehydrationToken); + var response = _employeeRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ContosoArmOperation(_employeeClientDiagnostics, Pipeline, _employeeRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -259,39 +255,39 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Updates tags on a snapshot. + /// Update a Employee /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_UpdateTags + /// Employees_Update /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Parameters supplied to the Update snapshot Tags operation. + /// The resource properties to be updated. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(EmployeePatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); + Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Update"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.Update"); scope.Start(); try { - var response = await _agentPoolSnapshotSnapshotsRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); + var response = await _employeeRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EmployeeResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -301,39 +297,39 @@ public virtual async Task> UpdateAsync(Conta } /// - /// Updates tags on a snapshot. + /// Update a Employee /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_UpdateTags + /// Employees_Update /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Parameters supplied to the Update snapshot Tags operation. + /// The resource properties to be updated. /// The cancellation token to use. - /// is null. - public virtual Response Update(ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + /// is null. + public virtual Response Update(EmployeePatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); + Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Update"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.Update"); scope.Start(); try { - var response = _agentPoolSnapshotSnapshotsRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken); - return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse()); + var response = _employeeRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new EmployeeResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -347,19 +343,19 @@ public virtual Response Update(ContainerServiceTagsOb /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Get + /// Employees_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// @@ -367,12 +363,12 @@ public virtual Response Update(ContainerServiceTagsOb /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.AddTag"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.AddTag"); scope.Start(); try { @@ -381,13 +377,13 @@ public virtual async Task> AddTagAsync(strin var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _employeeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EmployeeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); + var patch = new EmployeePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -409,19 +405,19 @@ public virtual async Task> AddTagAsync(strin /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Get + /// Employees_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// @@ -429,12 +425,12 @@ public virtual async Task> AddTagAsync(strin /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.AddTag"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.AddTag"); scope.Start(); try { @@ -443,13 +439,13 @@ public virtual Response AddTag(string key, string val var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _employeeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new EmployeeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); + var patch = new EmployeePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -471,30 +467,30 @@ public virtual Response AddTag(string key, string val /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Get + /// Employees_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.SetTags"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.SetTags"); scope.Start(); try { @@ -504,13 +500,13 @@ public virtual async Task> SetTagsAsync(IDic var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _employeeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EmployeeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); + var patch = new EmployeePatch(); patch.Tags.ReplaceWith(tags); var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); return result; @@ -528,30 +524,30 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Get + /// Employees_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.SetTags"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.SetTags"); scope.Start(); try { @@ -561,13 +557,13 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Get + /// Employees_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.RemoveTag"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.RemoveTag"); scope.Start(); try { @@ -617,13 +613,13 @@ public virtual async Task> RemoveTagAsync(st var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _employeeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EmployeeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ContainerServiceTagsObject(); + var patch = new EmployeePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -645,30 +641,30 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} /// /// /// Operation Id - /// Snapshots_Get + /// Employees_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2021-10-01-preview /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.RemoveTag"); + using var scope = _employeeClientDiagnostics.CreateScope("EmployeeResource.RemoveTag"); scope.Start(); try { @@ -677,13 +673,13 @@ public virtual Response RemoveTag(string key, Cancell var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _employeeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new EmployeeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ContainerServiceTagsObject(); + var patch = new EmployeePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/ContosoExtensions.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/ContosoExtensions.cs new file mode 100644 index 000000000000..80a8ce74c679 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/ContosoExtensions.cs @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Contoso.Mocking; +using Azure.ResourceManager.Contoso.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Contoso +{ + /// A class to add extension methods to Azure.ResourceManager.Contoso. + public static partial class ContosoExtensions + { + private static MockableContosoArmClient GetMockableContosoArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableContosoArmClient(client0)); + } + + private static MockableContosoResourceGroupResource GetMockableContosoResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableContosoResourceGroupResource(client, resource.Id)); + } + + private static MockableContosoSubscriptionResource GetMockableContosoSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableContosoSubscriptionResource(client, resource.Id)); + } + + private static MockableContosoTenantResource GetMockableContosoTenantResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableContosoTenantResource(client, resource.Id)); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static EmployeeResource GetEmployeeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContosoArmClient(client).GetEmployeeResource(id); + } + + /// + /// Gets a collection of EmployeeResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of EmployeeResources and their operations over a EmployeeResource. + public static EmployeeCollection GetEmployees(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableContosoResourceGroupResource(resourceGroupResource).GetEmployees(); + } + + /// + /// Get a Employee + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Employee. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetEmployeeAsync(this ResourceGroupResource resourceGroupResource, string employeeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableContosoResourceGroupResource(resourceGroupResource).GetEmployeeAsync(employeeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Employee + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Employee. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetEmployee(this ResourceGroupResource resourceGroupResource, string employeeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableContosoResourceGroupResource(resourceGroupResource).GetEmployee(employeeName, cancellationToken); + } + + /// + /// List Employee resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Contoso/employees + /// + /// + /// Operation Id + /// Employee_ListBySubscription + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetEmployeesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableContosoSubscriptionResource(subscriptionResource).GetEmployeesAsync(cancellationToken); + } + + /// + /// List Employee resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Contoso/employees + /// + /// + /// Operation Id + /// Employee_ListBySubscription + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetEmployees(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableContosoSubscriptionResource(subscriptionResource).GetEmployees(cancellationToken); + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.Contoso/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetOperationsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableContosoTenantResource(tenantResource).GetOperationsAsync(cancellationToken); + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.Contoso/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetOperations(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableContosoTenantResource(tenantResource).GetOperations(cancellationToken); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoArmClient.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoArmClient.cs new file mode 100644 index 000000000000..9dd8be4758d4 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoArmClient.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.Contoso.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableContosoArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableContosoArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableContosoArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableContosoArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EmployeeResource GetEmployeeResource(ResourceIdentifier id) + { + EmployeeResource.ValidateResourceId(id); + return new EmployeeResource(Client, id); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoResourceGroupResource.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoResourceGroupResource.cs new file mode 100644 index 000000000000..a12bec4706e2 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Contoso.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableContosoResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableContosoResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableContosoResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of EmployeeResources in the ResourceGroupResource. + /// An object representing collection of EmployeeResources and their operations over a EmployeeResource. + public virtual EmployeeCollection GetEmployees() + { + return GetCachedClient(client => new EmployeeCollection(client, Id)); + } + + /// + /// Get a Employee + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Employee. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEmployeeAsync(string employeeName, CancellationToken cancellationToken = default) + { + return await GetEmployees().GetAsync(employeeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Employee + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName} + /// + /// + /// Operation Id + /// Employees_Get + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Employee. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEmployee(string employeeName, CancellationToken cancellationToken = default) + { + return GetEmployees().Get(employeeName, cancellationToken); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoSubscriptionResource.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoSubscriptionResource.cs new file mode 100644 index 000000000000..c50eece14467 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Contoso.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableContosoSubscriptionResource : ArmResource + { + private ClientDiagnostics _employeeClientDiagnostics; + private EmployeesRestOperations _employeeRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableContosoSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableContosoSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics EmployeeClientDiagnostics => _employeeClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Contoso", EmployeeResource.ResourceType.Namespace, Diagnostics); + private EmployeesRestOperations EmployeeRestClient => _employeeRestClient ??= new EmployeesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EmployeeResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List Employee resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Contoso/employees + /// + /// + /// Operation Id + /// Employee_ListBySubscription + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetEmployeesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EmployeeRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EmployeeRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EmployeeResource(Client, EmployeeData.DeserializeEmployeeData(e)), EmployeeClientDiagnostics, Pipeline, "MockableContosoSubscriptionResource.GetEmployees", "value", "nextLink", cancellationToken); + } + + /// + /// List Employee resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Contoso/employees + /// + /// + /// Operation Id + /// Employee_ListBySubscription + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetEmployees(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EmployeeRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EmployeeRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EmployeeResource(Client, EmployeeData.DeserializeEmployeeData(e)), EmployeeClientDiagnostics, Pipeline, "MockableContosoSubscriptionResource.GetEmployees", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoTenantResource.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoTenantResource.cs new file mode 100644 index 000000000000..8540ed8e370f --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Extensions/MockableContosoTenantResource.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Contoso.Models; + +namespace Azure.ResourceManager.Contoso.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class MockableContosoTenantResource : ArmResource + { + private ClientDiagnostics _operationsClientDiagnostics; + private OperationsRestOperations _operationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableContosoTenantResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableContosoTenantResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics OperationsClientDiagnostics => _operationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Contoso", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private OperationsRestOperations OperationsRestClient => _operationsRestClient ??= new OperationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.Contoso/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Models.Operation.DeserializeOperation(e), OperationsClientDiagnostics, Pipeline, "MockableContosoTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.Contoso/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetOperations(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Models.Operation.DeserializeOperation(e), OperationsClientDiagnostics, Pipeline, "MockableContosoTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Argument.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..b146fadb7828 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Contoso +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..c2b481265f05 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Contoso +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ChangeTrackingList.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..28e10b878f86 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Contoso +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..02e26e5900f4 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.Contoso +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Optional.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..3d6bd293a801 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.Contoso +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..50d04f500cd4 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Contoso +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/ContosoArmOperation.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/ContosoArmOperation.cs new file mode 100644 index 000000000000..2badd30f1f7b --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/ContosoArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Contoso +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ContosoArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ContosoArmOperation for mocking. + protected ContosoArmOperation() + { + } + + internal ContosoArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ContosoArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "ContosoArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/ContosoArmOperationOfT.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/ContosoArmOperationOfT.cs new file mode 100644 index 000000000000..4b59643530b2 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/ContosoArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Contoso +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ContosoArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ContosoArmOperation for mocking. + protected ContosoArmOperation() + { + } + + internal ContosoArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ContosoArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "ContosoArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/EmployeeOperationSource.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/EmployeeOperationSource.cs new file mode 100644 index 000000000000..779508e84bbc --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/LongRunningOperation/EmployeeOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Contoso +{ + internal class EmployeeOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal EmployeeOperationSource(ArmClient client) + { + _client = client; + } + + EmployeeResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EmployeeData.DeserializeEmployeeData(document.RootElement); + return new EmployeeResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EmployeeData.DeserializeEmployeeData(document.RootElement); + return new EmployeeResource(_client, data); + } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/ActionType.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/ActionType.cs new file mode 100644 index 000000000000..b1c7ce120bde --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/ActionType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Contoso.Models +{ + /// Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + public readonly partial struct ActionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ActionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InternalValue = "Internal"; + + /// Actions are for internal-only APIs. + public static ActionType Internal { get; } = new ActionType(InternalValue); + /// Determines if two values are the same. + public static bool operator ==(ActionType left, ActionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ActionType left, ActionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ActionType(string value) => new ActionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ActionType other && Equals(other); + /// + public bool Equals(ActionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.Serialization.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeListResult.Serialization.cs similarity index 60% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.Serialization.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeListResult.Serialization.cs index ecaa2d829b7c..ad0accd087ca 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/CompatibleVersions.Serialization.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeListResult.Serialization.cs @@ -11,35 +11,32 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso.Models { - public partial class CompatibleVersions : IUtf8JsonSerializable, IJsonModel + internal partial class EmployeeListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CompatibleVersions)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EmployeeListResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Name)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); + writer.WriteObjectValue(item, options); } - if (Optional.IsCollectionDefined(Versions)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - writer.WritePropertyName("versions"u8); - writer.WriteStartArray(); - foreach (var item in Versions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -59,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - CompatibleVersions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EmployeeListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CompatibleVersions)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EmployeeListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCompatibleVersions(document.RootElement, options); + return DeserializeEmployeeListResult(document.RootElement, options); } - internal static CompatibleVersions DeserializeCompatibleVersions(JsonElement element, ModelReaderWriterOptions options = null) + internal static EmployeeListResult DeserializeEmployeeListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,29 +76,29 @@ internal static CompatibleVersions DeserializeCompatibleVersions(JsonElement ele { return null; } - string name = default; - IList versions = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (property.NameEquals("value"u8)) { - name = property.Value.GetString(); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EmployeeData.DeserializeEmployeeData(item, options)); + } + value = array; continue; } - if (property.NameEquals("versions"u8)) + if (property.NameEquals("nextLink"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - versions = array; + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -110,38 +107,38 @@ internal static CompatibleVersions DeserializeCompatibleVersions(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new CompatibleVersions(name, versions ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new EmployeeListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(CompatibleVersions)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmployeeListResult)} does not support writing '{options.Format}' format."); } } - CompatibleVersions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EmployeeListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCompatibleVersions(document.RootElement, options); + return DeserializeEmployeeListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CompatibleVersions)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmployeeListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeListResult.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeListResult.cs new file mode 100644 index 000000000000..f40f6693d057 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Contoso.Models +{ + /// The response of a Employee list operation. + internal partial class EmployeeListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Employee items on this page. + /// is null. + internal EmployeeListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Employee items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EmployeeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EmployeeListResult() + { + } + + /// The Employee items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeePatch.Serialization.cs similarity index 56% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeePatch.Serialization.cs index 2603f4dc2040..6181b158f9f5 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeePatch.Serialization.cs @@ -11,34 +11,37 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso.Models { - public partial class IstioEgressGateway : IUtf8JsonSerializable, IJsonModel + public partial class EmployeePatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioEgressGateway)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EmployeePatch)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled); - if (Optional.IsCollectionDefined(NodeSelector)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("nodeSelector"u8); + writer.WritePropertyName("tags"u8); writer.WriteStartObject(); - foreach (var item in NodeSelector) + foreach (var item in Tags) { writer.WritePropertyName(item.Key); writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -57,19 +60,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - IstioEgressGateway IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EmployeePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioEgressGateway)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EmployeePatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioEgressGateway(document.RootElement, options); + return DeserializeEmployeePatch(document.RootElement, options); } - internal static IstioEgressGateway DeserializeIstioEgressGateway(JsonElement element, ModelReaderWriterOptions options = null) + internal static EmployeePatch DeserializeEmployeePatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,18 +80,13 @@ internal static IstioEgressGateway DeserializeIstioEgressGateway(JsonElement ele { return null; } - bool enabled = default; - IDictionary nodeSelector = default; + IDictionary tags = default; + EmployeeUpdateProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("enabled"u8)) - { - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("nodeSelector"u8)) + if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { @@ -99,7 +97,16 @@ internal static IstioEgressGateway DeserializeIstioEgressGateway(JsonElement ele { dictionary.Add(property0.Name, property0.Value.GetString()); } - nodeSelector = dictionary; + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = EmployeeUpdateProperties.DeserializeEmployeeUpdateProperties(property.Value, options); continue; } if (options.Format != "W") @@ -108,38 +115,38 @@ internal static IstioEgressGateway DeserializeIstioEgressGateway(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new IstioEgressGateway(enabled, nodeSelector ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new EmployeePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(IstioEgressGateway)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmployeePatch)} does not support writing '{options.Format}' format."); } } - IstioEgressGateway IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EmployeePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIstioEgressGateway(document.RootElement, options); + return DeserializeEmployeePatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IstioEgressGateway)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmployeePatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeePatch.cs similarity index 62% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeePatch.cs index 3e4c34f5bf30..82fcaacc1167 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterManagedOutboundIPProfile.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeePatch.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso.Models { - /// Profile of the managed outbound IP resources of the managed cluster. - internal partial class ManagedClusterManagedOutboundIPProfile + /// The type used for update operations of the Employee. + public partial class EmployeePatch { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,26 @@ internal partial class ManagedClusterManagedOutboundIPProfile /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ManagedClusterManagedOutboundIPProfile() + /// Initializes a new instance of . + public EmployeePatch() { + Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . - /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. + /// Initializes a new instance of . + /// Resource tags. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal ManagedClusterManagedOutboundIPProfile(int? count, IDictionary serializedAdditionalRawData) + internal EmployeePatch(IDictionary tags, EmployeeUpdateProperties properties, IDictionary serializedAdditionalRawData) { - Count = count; + Tags = tags; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. - public int? Count { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public EmployeeUpdateProperties Properties { get; set; } } } diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeProperties.Serialization.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeProperties.Serialization.cs new file mode 100644 index 000000000000..02c7d6e4230f --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeProperties.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Contoso.Models +{ + public partial class EmployeeProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmployeeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Age)) + { + writer.WritePropertyName("age"u8); + writer.WriteNumberValue(Age.Value); + } + if (Optional.IsDefined(City)) + { + writer.WritePropertyName("city"u8); + writer.WriteStringValue(City); + } + if (Optional.IsDefined(Profile)) + { + writer.WritePropertyName("profile"u8); + writer.WriteBase64StringValue(Profile, "U"); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EmployeeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmployeeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEmployeeProperties(document.RootElement, options); + } + + internal static EmployeeProperties DeserializeEmployeeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? age = default; + string city = default; + byte[] profile = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("age"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + age = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("city"u8)) + { + city = property.Value.GetString(); + continue; + } + if (property.NameEquals("profile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + profile = property.Value.GetBytesFromBase64("U"); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EmployeeProperties(age, city, profile, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EmployeeProperties)} does not support writing '{options.Format}' format."); + } + } + + EmployeeProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEmployeeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EmployeeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeProperties.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeProperties.cs index 1539915c877f..f17e5ee5c7df 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/TrustedAccessRoleBindingListResult.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeProperties.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso.Models { - /// List of trusted access role bindings. - internal partial class TrustedAccessRoleBindingListResult + /// Employee properties. + public partial class EmployeeProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,33 @@ internal partial class TrustedAccessRoleBindingListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal TrustedAccessRoleBindingListResult() + /// Initializes a new instance of . + public EmployeeProperties() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Role binding list. - /// Link to next page of resources. + /// Initializes a new instance of . + /// Age of employee. + /// City of employee. + /// Profile of employee. + /// The status of the last operation. /// Keeps track of any properties unknown to the library. - internal TrustedAccessRoleBindingListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal EmployeeProperties(int? age, string city, byte[] profile, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + Age = age; + City = city; + Profile = profile; + ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Role binding list. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } + /// Age of employee. + public int? Age { get; set; } + /// City of employee. + public string City { get; set; } + /// Profile of employee. + public byte[] Profile { get; set; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.Serialization.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeUpdateProperties.Serialization.cs similarity index 55% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.Serialization.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeUpdateProperties.Serialization.cs index dccfe7525389..212e6255a609 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterListResult.Serialization.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeUpdateProperties.Serialization.cs @@ -11,35 +11,35 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso.Models { - internal partial class ManagedClusterListResult : IUtf8JsonSerializable, IJsonModel + public partial class EmployeeUpdateProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EmployeeUpdateProperties)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) + if (Optional.IsDefined(Age)) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("age"u8); + writer.WriteNumberValue(Age.Value); + } + if (Optional.IsDefined(City)) + { + writer.WritePropertyName("city"u8); + writer.WriteStringValue(City); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + if (Optional.IsDefined(Profile)) { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WritePropertyName("profile"u8); + writer.WriteBase64StringValue(Profile, "U"); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteEndObject(); } - ManagedClusterListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EmployeeUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedClusterListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EmployeeUpdateProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedClusterListResult(document.RootElement, options); + return DeserializeEmployeeUpdateProperties(document.RootElement, options); } - internal static ManagedClusterListResult DeserializeManagedClusterListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static EmployeeUpdateProperties DeserializeEmployeeUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,29 +79,34 @@ internal static ManagedClusterListResult DeserializeManagedClusterListResult(Jso { return null; } - IReadOnlyList value = default; - string nextLink = default; + int? age = default; + string city = default; + byte[] profile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (property.NameEquals("age"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(item, options)); - } - value = array; + age = property.Value.GetInt32(); continue; } - if (property.NameEquals("nextLink"u8)) + if (property.NameEquals("city"u8)) { - nextLink = property.Value.GetString(); + city = property.Value.GetString(); + continue; + } + if (property.NameEquals("profile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + profile = property.Value.GetBytesFromBase64("U"); continue; } if (options.Format != "W") @@ -110,38 +115,38 @@ internal static ManagedClusterListResult DeserializeManagedClusterListResult(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new EmployeeUpdateProperties(age, city, profile, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ManagedClusterListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmployeeUpdateProperties)} does not support writing '{options.Format}' format."); } } - ManagedClusterListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EmployeeUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeManagedClusterListResult(document.RootElement, options); + return DeserializeEmployeeUpdateProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedClusterListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmployeeUpdateProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeUpdateProperties.cs similarity index 62% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeUpdateProperties.cs index 87cdd6491078..0bcc319dec11 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterStorageProfileSnapshotController.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/EmployeeUpdateProperties.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso.Models { - /// Snapshot Controller settings for the storage profile. - internal partial class ManagedClusterStorageProfileSnapshotController + /// The updatable properties of the Employee. + public partial class EmployeeUpdateProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,29 @@ internal partial class ManagedClusterStorageProfileSnapshotController /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ManagedClusterStorageProfileSnapshotController() + /// Initializes a new instance of . + public EmployeeUpdateProperties() { } - /// Initializes a new instance of . - /// Whether to enable Snapshot Controller. The default value is true. + /// Initializes a new instance of . + /// Age of employee. + /// City of employee. + /// Profile of employee. /// Keeps track of any properties unknown to the library. - internal ManagedClusterStorageProfileSnapshotController(bool? isEnabled, IDictionary serializedAdditionalRawData) + internal EmployeeUpdateProperties(int? age, string city, byte[] profile, IDictionary serializedAdditionalRawData) { - IsEnabled = isEnabled; + Age = age; + City = city; + Profile = profile; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Whether to enable Snapshot Controller. The default value is true. - public bool? IsEnabled { get; set; } + /// Age of employee. + public int? Age { get; set; } + /// City of employee. + public string City { get; set; } + /// Profile of employee. + public byte[] Profile { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.Serialization.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Operation.Serialization.cs similarity index 51% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.Serialization.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Operation.Serialization.cs index 630dc60ec8b1..292ac5319431 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileData.Serialization.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Operation.Serialization.cs @@ -10,48 +10,46 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.ContainerService.Models; -using Azure.ResourceManager.Models; -namespace Azure.ResourceManager.ContainerService +namespace Azure.ResourceManager.Contoso.Models { - public partial class MeshRevisionProfileData : IUtf8JsonSerializable, IJsonModel + public partial class Operation : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevisionProfileData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(Operation)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) + if (options.Format != "W" && Optional.IsDefined(Name)) { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); } - if (options.Format != "W") + if (options.Format != "W" && Optional.IsDefined(IsDataAction)) { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); + writer.WritePropertyName("isDataAction"u8); + writer.WriteBooleanValue(IsDataAction.Value); } - if (options.Format != "W") + if (options.Format != "W" && Optional.IsDefined(Display)) { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); + writer.WritePropertyName("display"u8); + writer.WriteObjectValue(Display, options); } - if (options.Format != "W") + if (options.Format != "W" && Optional.IsDefined(Origin)) { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); + writer.WritePropertyName("origin"u8); + writer.WriteStringValue(Origin.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(SystemData)) + if (Optional.IsDefined(ActionType)) { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); + writer.WritePropertyName("actionType"u8); + writer.WriteStringValue(ActionType.Value.ToString()); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -71,19 +69,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - MeshRevisionProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + Operation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MeshRevisionProfileData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(Operation)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMeshRevisionProfileData(document.RootElement, options); + return DeserializeOperation(document.RootElement, options); } - internal static MeshRevisionProfileData DeserializeMeshRevisionProfileData(JsonElement element, ModelReaderWriterOptions options = null) + internal static Operation DeserializeOperation(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,46 +89,54 @@ internal static MeshRevisionProfileData DeserializeMeshRevisionProfileData(JsonE { return null; } - MeshRevisionProfileProperties properties = default; - ResourceIdentifier id = default; string name = default; - ResourceType type = default; - SystemData systemData = default; + bool? isDataAction = default; + OperationDisplay display = default; + Origin? origin = default; + ActionType? actionType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDataAction"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = MeshRevisionProfileProperties.DeserializeMeshRevisionProfileProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); + isDataAction = property.Value.GetBoolean(); continue; } - if (property.NameEquals("name"u8)) + if (property.NameEquals("display"u8)) { - name = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + display = OperationDisplay.DeserializeOperationDisplay(property.Value, options); continue; } - if (property.NameEquals("type"u8)) + if (property.NameEquals("origin"u8)) { - type = new ResourceType(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + origin = new Origin(property.Value.GetString()); continue; } - if (property.NameEquals("systemData"u8)) + if (property.NameEquals("actionType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + actionType = new ActionType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -139,44 +145,44 @@ internal static MeshRevisionProfileData DeserializeMeshRevisionProfileData(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new MeshRevisionProfileData( - id, + return new Operation( name, - type, - systemData, - properties, + isDataAction, + display, + origin, + actionType, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MeshRevisionProfileData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(Operation)} does not support writing '{options.Format}' format."); } } - MeshRevisionProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + Operation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMeshRevisionProfileData(document.RootElement, options); + return DeserializeOperation(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MeshRevisionProfileData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(Operation)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Operation.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Operation.cs new file mode 100644 index 000000000000..25b12d070618 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Operation.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Contoso.Models +{ + /// Details of a REST API operation, returned from the Resource Provider Operations API. + public partial class Operation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal Operation() + { + } + + /// Initializes a new instance of . + /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. + /// Localized display information for this particular operation. + /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". + /// Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + /// Keeps track of any properties unknown to the library. + internal Operation(string name, bool? isDataAction, OperationDisplay display, Origin? origin, ActionType? actionType, IDictionary serializedAdditionalRawData) + { + Name = name; + IsDataAction = isDataAction; + Display = display; + Origin = origin; + ActionType = actionType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + public string Name { get; } + /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. + public bool? IsDataAction { get; } + /// Localized display information for this particular operation. + public OperationDisplay Display { get; } + /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". + public Origin? Origin { get; } + /// Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + public ActionType? ActionType { get; } + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationDisplay.Serialization.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationDisplay.Serialization.cs new file mode 100644 index 000000000000..963029b29aac --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationDisplay.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Contoso.Models +{ + public partial class OperationDisplay : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationDisplay)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(Provider)) + { + writer.WritePropertyName("provider"u8); + writer.WriteStringValue(Provider); + } + if (options.Format != "W" && Optional.IsDefined(Resource)) + { + writer.WritePropertyName("resource"u8); + writer.WriteStringValue(Resource); + } + if (options.Format != "W" && Optional.IsDefined(Operation)) + { + writer.WritePropertyName("operation"u8); + writer.WriteStringValue(Operation); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OperationDisplay IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationDisplay)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationDisplay(document.RootElement, options); + } + + internal static OperationDisplay DeserializeOperationDisplay(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string provider = default; + string resource = default; + string operation = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provider"u8)) + { + provider = property.Value.GetString(); + continue; + } + if (property.NameEquals("resource"u8)) + { + resource = property.Value.GetString(); + continue; + } + if (property.NameEquals("operation"u8)) + { + operation = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationDisplay(provider, resource, operation, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OperationDisplay)} does not support writing '{options.Format}' format."); + } + } + + OperationDisplay IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOperationDisplay(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationDisplay)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationDisplay.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..d6449f271042 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Contoso.Models +{ + /// Localized display information for and operation. + public partial class OperationDisplay + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal OperationDisplay() + { + } + + /// Initializes a new instance of . + /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. + /// Keeps track of any properties unknown to the library. + internal OperationDisplay(string provider, string resource, string operation, string description, IDictionary serializedAdditionalRawData) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + public string Provider { get; } + /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + public string Resource { get; } + /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + public string Operation { get; } + /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. + public string Description { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.Serialization.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationListResult.Serialization.cs similarity index 53% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.Serialization.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationListResult.Serialization.cs index b0119906119c..2d77d1df073b 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.Serialization.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationListResult.Serialization.cs @@ -11,18 +11,18 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso.Models { - internal partial class OutboundEnvironmentEndpointListResult : IUtf8JsonSerializable, IJsonModel + internal partial class OperationListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OutboundEnvironmentEndpointListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(OperationListResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -33,10 +33,10 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - if (options.Format != "W" && Optional.IsDefined(NextLink)) + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -56,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteEndObject(); } - OutboundEnvironmentEndpointListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + OperationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OutboundEnvironmentEndpointListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(OperationListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOutboundEnvironmentEndpointListResult(document.RootElement, options); + return DeserializeOperationListResult(document.RootElement, options); } - internal static OutboundEnvironmentEndpointListResult DeserializeOutboundEnvironmentEndpointListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static OperationListResult DeserializeOperationListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,25 +76,29 @@ internal static OutboundEnvironmentEndpointListResult DeserializeOutboundEnviron { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ContainerServiceOutboundEnvironmentEndpoint.DeserializeContainerServiceOutboundEnvironmentEndpoint(item, options)); + array.Add(Operation.DeserializeOperation(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -103,38 +107,38 @@ internal static OutboundEnvironmentEndpointListResult DeserializeOutboundEnviron } } serializedAdditionalRawData = rawDataDictionary; - return new OutboundEnvironmentEndpointListResult(value, nextLink, serializedAdditionalRawData); + return new OperationListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(OutboundEnvironmentEndpointListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(OperationListResult)} does not support writing '{options.Format}' format."); } } - OutboundEnvironmentEndpointListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + OperationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOutboundEnvironmentEndpointListResult(document.RootElement, options); + return DeserializeOperationListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OutboundEnvironmentEndpointListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(OperationListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationListResult.cs similarity index 65% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationListResult.cs index da8bd850a121..02309548d4f6 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/OutboundEnvironmentEndpointListResult.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/OperationListResult.cs @@ -9,10 +9,10 @@ using System.Collections.Generic; using System.Linq; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.Contoso.Models { - /// Collection of OutboundEnvironmentEndpoint. - internal partial class OutboundEnvironmentEndpointListResult + /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + internal partial class OperationListResult { /// /// Keeps track of any properties unknown to the library. @@ -46,35 +46,35 @@ internal partial class OutboundEnvironmentEndpointListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Collection of resources. + /// Initializes a new instance of . + /// The Operation items on this page. /// is null. - internal OutboundEnvironmentEndpointListResult(IEnumerable value) + internal OperationListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); Value = value.ToList(); } - /// Initializes a new instance of . - /// Collection of resources. - /// Link to next page of resources. + /// Initializes a new instance of . + /// The Operation items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal OutboundEnvironmentEndpointListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal OperationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal OutboundEnvironmentEndpointListResult() + /// Initializes a new instance of for deserialization. + internal OperationListResult() { } - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } + /// The Operation items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Origin.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Origin.cs new file mode 100644 index 000000000000..14810d6acf64 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/Origin.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Contoso.Models +{ + /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". + public readonly partial struct Origin : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Origin(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserValue = "user"; + private const string SystemValue = "system"; + private const string UserSystemValue = "user,system"; + + /// Indicates the operation is initiated by a user. + public static Origin User { get; } = new Origin(UserValue); + /// Indicates the operation is initiated by a system. + public static Origin System { get; } = new Origin(SystemValue); + /// Indicates the operation is initiated by a user or system. + public static Origin UserSystem { get; } = new Origin(UserSystemValue); + /// Determines if two values are the same. + public static bool operator ==(Origin left, Origin right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Origin left, Origin right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Origin(string value) => new Origin(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Origin other && Equals(other); + /// + public bool Equals(Origin other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/ProvisioningState.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..ff4962664eca --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Contoso.Models +{ + /// The resource provisioning state. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// The resource is being provisioned. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// The resource is updating. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// The resource is being deleted. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// The resource create request has been accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/ProviderConstants.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..58224a637312 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Contoso +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/RestOperations/EmployeesRestOperations.cs similarity index 68% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/RestOperations/EmployeesRestOperations.cs index 5bb4a6a7ea25..b4e01de6dbfc 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/RestOperations/EmployeesRestOperations.cs @@ -11,43 +11,46 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Contoso.Models; -namespace Azure.ResourceManager.ContainerService +namespace Azure.ResourceManager.Contoso { - internal partial class SnapshotsRestOperations + internal partial class EmployeesRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of SnapshotsRestOperations. + /// Initializes a new instance of EmployeesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// The to use. + /// The API version to use for this operation. /// or is null. - public SnapshotsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public EmployeesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2021-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string employeeName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees/", false); + uri.AppendPath(employeeName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string employeeName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -56,7 +59,10 @@ internal HttpMessage CreateListRequest(string subscriptionId) uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees/", false); + uri.AppendPath(employeeName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -64,57 +70,69 @@ internal HttpMessage CreateListRequest(string subscriptionId) return message; } - /// Gets a list of snapshots in the specified subscription. + /// Get a Employee. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Employee. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string employeeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); - using var message = CreateListRequest(subscriptionId); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, employeeName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + EmployeeData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = EmployeeData.DeserializeEmployeeData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((EmployeeData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets a list of snapshots in the specified subscription. + /// Get a Employee. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Employee. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string employeeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); - using var message = CreateListRequest(subscriptionId); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, employeeName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + EmployeeData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = EmployeeData.DeserializeEmployeeData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((EmployeeData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string employeeName, EmployeeData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -122,85 +140,91 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots", false); + uri.AppendPath("/providers/Microsoft.Contoso/employees/", false); + uri.AppendPath(employeeName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string employeeName, EmployeeData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots", false); + uri.AppendPath("/providers/Microsoft.Contoso/employees/", false); + uri.AppendPath(employeeName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Lists snapshots in the specified subscription and resource group. + /// Create a Employee. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the Employee. + /// Resource create parameters. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string employeeName, EmployeeData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, employeeName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - AgentPoolSnapshotListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Lists snapshots in the specified subscription and resource group. + /// Create a Employee. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the Employee. + /// Resource create parameters. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string employeeName, EmployeeData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, employeeName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - AgentPoolSnapshotListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string employeeName, EmployeePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -208,95 +232,99 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees/", false); + uri.AppendPath(employeeName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string employeeName, EmployeePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees/", false); + uri.AppendPath(employeeName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Gets a snapshot. + /// Update a Employee. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// The name of the Employee. + /// The resource properties to be updated. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string employeeName, EmployeePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, employeeName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotData value = default; + EmployeeData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); + value = EmployeeData.DeserializeEmployeeData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((AgentPoolSnapshotData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets a snapshot. + /// Update a Employee. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. + /// The name of the Employee. + /// The resource properties to be updated. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string employeeName, EmployeePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, employeeName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotData value = default; + EmployeeData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); + value = EmployeeData.DeserializeEmployeeData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((AgentPoolSnapshotData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, AgentPoolSnapshotData data) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string employeeName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -304,101 +332,83 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees/", false); + uri.AppendPath(employeeName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, AgentPoolSnapshotData data) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string employeeName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees/", false); + uri.AppendPath(employeeName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates or updates a snapshot. + /// Delete a Employee. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The snapshot to create or update. + /// The name of the Employee. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string employeeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, employeeName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - case 201: - { - AgentPoolSnapshotData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Creates or updates a snapshot. + /// Delete a Employee. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// The snapshot to create or update. + /// The name of the Employee. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, AgentPoolSnapshotData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string employeeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(employeeName, nameof(employeeName)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, employeeName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - case 201: - { - AgentPoolSnapshotData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -406,60 +416,50 @@ internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, str uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(containerServiceTagsObject, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Updates tags on a snapshot. + /// List Employee resources by resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Parameters supplied to the Update snapshot Tags operation. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateTagsAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotData value = default; + EmployeeListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); + value = EmployeeListResult.DeserializeEmployeeListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -467,30 +467,26 @@ public async Task> UpdateTagsAsync(string subscr } } - /// Updates tags on a snapshot. + /// List Employee resources by resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. - /// Parameters supplied to the Update snapshot Tags operation. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateTags(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotData value = default; + EmployeeListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(document.RootElement); + value = EmployeeListResult.DeserializeEmployeeListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -498,33 +494,27 @@ public Response UpdateTags(string subscriptionId, string } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ContainerService/snapshots/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.Contoso/employees", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -532,57 +522,57 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes a snapshot. + /// List Employee resources by subscription ID. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + EmployeeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EmployeeListResult.DeserializeEmployeeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Deletes a snapshot. + /// List Employee resources by subscription ID. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the managed cluster resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + EmployeeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EmployeeListResult.DeserializeEmployeeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -590,7 +580,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -604,26 +594,28 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Gets a list of snapshots in the specified subscription. + /// List Employee resources by resource group. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + EmployeeListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = EmployeeListResult.DeserializeEmployeeListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -631,26 +623,28 @@ public async Task> ListNextPageAsync(strin } } - /// Gets a list of snapshots in the specified subscription. + /// List Employee resources by resource group. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + EmployeeListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = EmployeeListResult.DeserializeEmployeeListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -658,7 +652,7 @@ public Response ListNextPage(string nextLink, strin } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -666,7 +660,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -680,28 +674,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Lists snapshots in the specified subscription and resource group. + /// List Employee resources by subscription ID. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + EmployeeListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = EmployeeListResult.DeserializeEmployeeListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -709,28 +701,26 @@ public async Task> ListByResourceGroupNext } } - /// Lists snapshots in the specified subscription and resource group. + /// List Employee resources by subscription ID. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AgentPoolSnapshotListResult value = default; + EmployeeListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AgentPoolSnapshotListResult.DeserializeAgentPoolSnapshotListResult(document.RootElement); + value = EmployeeListResult.DeserializeEmployeeListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/RestOperations/OperationsRestOperations.cs similarity index 50% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs rename to sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/RestOperations/OperationsRestOperations.cs index 5132b6d8d9f1..7056dcfe875a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Generated/RestOperations/OperationsRestOperations.cs @@ -11,56 +11,48 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.ContainerService.Models; +using Azure.ResourceManager.Contoso.Models; -namespace Azure.ResourceManager.ContainerService +namespace Azure.ResourceManager.Contoso { - internal partial class TrustedAccessRolesRestOperations + internal partial class OperationsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of TrustedAccessRolesRestOperations. + /// Initializes a new instance of OperationsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// The to use. + /// The API version to use for this operation. /// or is null. - public TrustedAccessRolesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public OperationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2021-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateListRequestUri() { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/trustedAccessRoles", false); + uri.AppendPath("/providers/Microsoft.Contoso/operations", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation location) + internal HttpMessage CreateListRequest() { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/trustedAccessRoles", false); + uri.AppendPath("/providers/Microsoft.Contoso/operations", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -68,25 +60,19 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca return message; } - /// List supported trusted access roles. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. + /// List the operations for the provider. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public async Task> ListAsync(CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, location); + using var message = CreateListRequest(); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - TrustedAccessRoleListResult value = default; + OperationListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TrustedAccessRoleListResult.DeserializeTrustedAccessRoleListResult(document.RootElement); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -94,25 +80,19 @@ public async Task> ListAsync(string subscr } } - /// List supported trusted access roles. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. + /// List the operations for the provider. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public Response List(CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, location); + using var message = CreateListRequest(); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - TrustedAccessRoleListResult value = default; + OperationListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TrustedAccessRoleListResult.DeserializeTrustedAccessRoleListResult(document.RootElement); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -120,7 +100,7 @@ public Response List(string subscriptionId, AzureLo } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -128,7 +108,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + internal HttpMessage CreateListNextPageRequest(string nextLink) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -142,27 +122,23 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// List supported trusted access roles. + /// List the operations for the provider. /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, location); + using var message = CreateListNextPageRequest(nextLink); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - TrustedAccessRoleListResult value = default; + OperationListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TrustedAccessRoleListResult.DeserializeTrustedAccessRoleListResult(document.RootElement); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -170,27 +146,23 @@ public async Task> ListNextPageAsync(strin } } - /// List supported trusted access roles. + /// List the operations for the provider. /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, location); + using var message = CreateListNextPageRequest(nextLink); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - TrustedAccessRoleListResult value = default; + OperationListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TrustedAccessRoleListResult.DeserializeTrustedAccessRoleListResult(document.RootElement); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/src/Properties/AssemblyInfo.cs b/sdk/contoso/Azure.ResourceManager.Contoso/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..10e9b36c67ee --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.Contoso.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/tests/Azure.ResourceManager.Contoso.Tests.csproj b/sdk/contoso/Azure.ResourceManager.Contoso/tests/Azure.ResourceManager.Contoso.Tests.csproj new file mode 100644 index 000000000000..c26f75771cc4 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/tests/Azure.ResourceManager.Contoso.Tests.csproj @@ -0,0 +1,12 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + diff --git a/sdk/contoso/Azure.ResourceManager.Contoso/tsp-location.yaml b/sdk/contoso/Azure.ResourceManager.Contoso/tsp-location.yaml new file mode 100644 index 000000000000..b7da4cb2e431 --- /dev/null +++ b/sdk/contoso/Azure.ResourceManager.Contoso/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/contosowidgetmanager/Contoso.Management +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/contoso/ci.yml b/sdk/contoso/ci.yml new file mode 100644 index 000000000000..021f885a590f --- /dev/null +++ b/sdk/contoso/ci.yml @@ -0,0 +1,35 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/contoso + - sdk/contoso/ci.yml + - sdk/contoso/Azure.ResourceManager.Contoso + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/contoso + - sdk/contoso/ci.yml + - sdk/contoso/Azure.ResourceManager.Contoso + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: contoso + ArtifactName: packages + Artifacts: + - name: Azure.ResourceManager.Contoso + safeName: AzureResourceManagerContoso diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/Azure.Template.Contoso.sln b/sdk/contosowidgetmanager/Azure.Template.Contoso/Azure.Template.Contoso.sln new file mode 100644 index 000000000000..b8a126d8fc2a --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/Azure.Template.Contoso.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Template.Contoso", "src\Azure.Template.Contoso.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Template.Contoso.Tests", "tests\Azure.Template.Contoso.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/CHANGELOG.md b/sdk/contosowidgetmanager/Azure.Template.Contoso/CHANGELOG.md new file mode 100644 index 000000000000..13dd08af78ab --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/Directory.Build.props b/sdk/contosowidgetmanager/Azure.Template.Contoso/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/README.md b/sdk/contosowidgetmanager/Azure.Template.Contoso/README.md new file mode 100644 index 000000000000..3f29e00422f7 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/README.md @@ -0,0 +1,107 @@ +# Azure.Template.Contoso client library for .NET + +Azure.Template.Contoso is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/contosowidgetmanager/Azure.Template.Contoso/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Template.Contoso --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateClientForSpecificApiVersion +Uri endpoint = new Uri(""); +DefaultAzureCredential credential = new DefaultAzureCredential(); +ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.) +var client = new Client(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/contosowidgetmanager/Azure.Template.Contoso/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/contosowidgetmanager/Azure.Template.Contoso/README.png) diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Azure.Template.Contoso.csproj b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Azure.Template.Contoso.csproj new file mode 100644 index 000000000000..8e26ba2f2db8 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Azure.Template.Contoso.csproj @@ -0,0 +1,19 @@ + + + This is the Azure.Template.Contoso client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.Template.Contoso for Azure Data Plane + 1.0.0-beta.1 + Azure.Template.Contoso + $(RequiredTargetFrameworks) + true + + + + + + + + + + + diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Docs/Widgets.xml b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Docs/Widgets.xml new file mode 100644 index 000000000000..6d13c7b27824 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Docs/Widgets.xml @@ -0,0 +1,509 @@ + + + + + +This sample shows how to call GetWidgetAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = await client.GetWidgetAsync(""); +]]> +This sample shows how to call GetWidgetAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = await client.GetWidgetAsync(""); +]]> + + + +This sample shows how to call GetWidget. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = client.GetWidget(""); +]]> +This sample shows how to call GetWidget with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = client.GetWidget(""); +]]> + + + +This sample shows how to call GetWidgetAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = await client.GetWidgetAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +]]> +This sample shows how to call GetWidgetAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = await client.GetWidgetAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); +]]> + + + +This sample shows how to call GetWidget and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = client.GetWidget("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +]]> +This sample shows how to call GetWidget with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = client.GetWidget("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); +]]> + + + +This sample shows how to call GetWidgetOperationStatusAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = await client.GetWidgetOperationStatusAsync("", ""); +]]> +This sample shows how to call GetWidgetOperationStatusAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = await client.GetWidgetOperationStatusAsync("", ""); +]]> + + + +This sample shows how to call GetWidgetOperationStatus. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = client.GetWidgetOperationStatus("", ""); +]]> +This sample shows how to call GetWidgetOperationStatus with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = client.GetWidgetOperationStatus("", ""); +]]> + + + +This sample shows how to call GetWidgetOperationStatusAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = await client.GetWidgetOperationStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetWidgetOperationStatusAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = await client.GetWidgetOperationStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("manufacturerId").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("sharedModel").GetProperty("tag").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("sharedModel").GetProperty("createdAt").ToString()); +]]> + + + +This sample shows how to call GetWidgetOperationStatus and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = client.GetWidgetOperationStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetWidgetOperationStatus with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Response response = client.GetWidgetOperationStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("manufacturerId").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("sharedModel").GetProperty("tag").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("sharedModel").GetProperty("createdAt").ToString()); +]]> + + + +This sample shows how to call GetWidgetsAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +await foreach (WidgetSuite item in client.GetWidgetsAsync()) +{ +} +]]> +This sample shows how to call GetWidgetsAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +await foreach (WidgetSuite item in client.GetWidgetsAsync()) +{ +} +]]> + + + +This sample shows how to call GetWidgets. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +foreach (WidgetSuite item in client.GetWidgets()) +{ +} +]]> +This sample shows how to call GetWidgets with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +foreach (WidgetSuite item in client.GetWidgets()) +{ +} +]]> + + + +This sample shows how to call GetWidgetsAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +await foreach (BinaryData item in client.GetWidgetsAsync(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +} +]]> +This sample shows how to call GetWidgetsAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +await foreach (BinaryData item in client.GetWidgetsAsync(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); +} +]]> + + + +This sample shows how to call GetWidgets and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +foreach (BinaryData item in client.GetWidgets(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +} +]]> +This sample shows how to call GetWidgets with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +foreach (BinaryData item in client.GetWidgets(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); +} +]]> + + + +This sample shows how to call CreateOrUpdateWidgetAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +using RequestContent content = RequestContent.Create(new +{ + manufacturerId = "", +}); +Operation operation = await client.CreateOrUpdateWidgetAsync(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +]]> +This sample shows how to call CreateOrUpdateWidgetAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +using RequestContent content = RequestContent.Create(new +{ + manufacturerId = "", + sharedModel = new + { + tag = "", + createdAt = "2022-05-10T18:57:31.2311892Z", + }, +}); +Operation operation = await client.CreateOrUpdateWidgetAsync(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdateWidget and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +using RequestContent content = RequestContent.Create(new +{ + manufacturerId = "", +}); +Operation operation = client.CreateOrUpdateWidget(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +]]> +This sample shows how to call CreateOrUpdateWidget with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +using RequestContent content = RequestContent.Create(new +{ + manufacturerId = "", + sharedModel = new + { + tag = "", + createdAt = "2022-05-10T18:57:31.2311892Z", + }, +}); +Operation operation = client.CreateOrUpdateWidget(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); +]]> + + + +This sample shows how to call DeleteWidgetAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Operation operation = await client.DeleteWidgetAsync(WaitUntil.Completed, ""); +WidgetSuite responseData = operation.Value; +]]> +This sample shows how to call DeleteWidgetAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Operation operation = await client.DeleteWidgetAsync(WaitUntil.Completed, ""); +WidgetSuite responseData = operation.Value; +]]> + + + +This sample shows how to call DeleteWidget. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Operation operation = client.DeleteWidget(WaitUntil.Completed, ""); +WidgetSuite responseData = operation.Value; +]]> +This sample shows how to call DeleteWidget with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Operation operation = client.DeleteWidget(WaitUntil.Completed, ""); +WidgetSuite responseData = operation.Value; +]]> + + + +This sample shows how to call DeleteWidgetAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Operation operation = await client.DeleteWidgetAsync(WaitUntil.Completed, "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +]]> +This sample shows how to call DeleteWidgetAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Operation operation = await client.DeleteWidgetAsync(WaitUntil.Completed, "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); +]]> + + + +This sample shows how to call DeleteWidget and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Operation operation = client.DeleteWidget(WaitUntil.Completed, "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +]]> +This sample shows how to call DeleteWidget with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + +Operation operation = client.DeleteWidget(WaitUntil.Completed, "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("manufacturerId").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); +Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/FakedSharedModel.Serialization.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/FakedSharedModel.Serialization.cs new file mode 100644 index 000000000000..e2c446855a8c --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/FakedSharedModel.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Template.Contoso +{ + public partial class FakedSharedModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FakedSharedModel)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("tag"u8); + writer.WriteStringValue(Tag); + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt, "O"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FakedSharedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FakedSharedModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFakedSharedModel(document.RootElement, options); + } + + internal static FakedSharedModel DeserializeFakedSharedModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tag = default; + DateTimeOffset createdAt = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tag"u8)) + { + tag = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FakedSharedModel(tag, createdAt, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FakedSharedModel)} does not support writing '{options.Format}' format."); + } + } + + FakedSharedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFakedSharedModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FakedSharedModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FakedSharedModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFakedSharedModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/FakedSharedModel.cs similarity index 58% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.cs rename to sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/FakedSharedModel.cs index fb5f84dec443..0ebce4cf58ed 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceIPTag.cs +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/FakedSharedModel.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Template.Contoso { - /// Contains the IPTag associated with the object. - public partial class ContainerServiceIPTag + /// Faked shared model. + public partial class FakedSharedModel { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,37 @@ public partial class ContainerServiceIPTag /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ContainerServiceIPTag() + /// Initializes a new instance of . + /// The tag. + /// The created date. + /// is null. + public FakedSharedModel(string tag, DateTimeOffset createdAt) { + Argument.AssertNotNull(tag, nameof(tag)); + + Tag = tag; + CreatedAt = createdAt; } - /// Initializes a new instance of . - /// The IP tag type. Example: RoutingPreference. - /// The value of the IP tag associated with the public IP. Example: Internet. + /// Initializes a new instance of . + /// The tag. + /// The created date. /// Keeps track of any properties unknown to the library. - internal ContainerServiceIPTag(string ipTagType, string tag, IDictionary serializedAdditionalRawData) + internal FakedSharedModel(string tag, DateTimeOffset createdAt, IDictionary serializedAdditionalRawData) { - IPTagType = ipTagType; Tag = tag; + CreatedAt = createdAt; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The IP tag type. Example: RoutingPreference. - public string IPTagType { get; set; } - /// The value of the IP tag associated with the public IP. Example: Internet. + /// Initializes a new instance of for deserialization. + internal FakedSharedModel() + { + } + + /// The tag. public string Tag { get; set; } + /// The created date. + public DateTimeOffset CreatedAt { get; set; } } } diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Argument.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..6d81344fe1d7 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Template.Contoso +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..fba592e87808 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Template.Contoso +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ChangeTrackingList.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..5d1cec4e0093 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Template.Contoso +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..b36010df19bd --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.Template.Contoso +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Optional.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..072e7659b006 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Template.Contoso +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..6dbde35752a2 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.Template.Contoso +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/OperationState.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/OperationState.cs new file mode 100644 index 000000000000..40d339112461 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/OperationState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Template.Contoso +{ + /// Enum describing allowed operation states. + public readonly partial struct OperationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OperationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string RunningValue = "Running"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// The operation has not started. + public static OperationState NotStarted { get; } = new OperationState(NotStartedValue); + /// The operation is in progress. + public static OperationState Running { get; } = new OperationState(RunningValue); + /// The operation has completed successfully. + public static OperationState Succeeded { get; } = new OperationState(SucceededValue); + /// The operation has failed. + public static OperationState Failed { get; } = new OperationState(FailedValue); + /// The operation has been canceled by the user. + public static OperationState Canceled { get; } = new OperationState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(OperationState left, OperationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OperationState left, OperationState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator OperationState(string value) => new OperationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OperationState other && Equals(other); + /// + public bool Equals(OperationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/ResourceOperationStatusWidgetSuiteWidgetSuiteError.Serialization.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/ResourceOperationStatusWidgetSuiteWidgetSuiteError.Serialization.cs new file mode 100644 index 000000000000..d6daf5be98b7 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/ResourceOperationStatusWidgetSuiteWidgetSuiteError.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Template.Contoso +{ + public partial class ResourceOperationStatusWidgetSuiteWidgetSuiteError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceOperationStatusWidgetSuiteWidgetSuiteError)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (Optional.IsDefined(Result)) + { + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ResourceOperationStatusWidgetSuiteWidgetSuiteError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceOperationStatusWidgetSuiteWidgetSuiteError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceOperationStatusWidgetSuiteWidgetSuiteError(document.RootElement, options); + } + + internal static ResourceOperationStatusWidgetSuiteWidgetSuiteError DeserializeResourceOperationStatusWidgetSuiteWidgetSuiteError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + OperationState status = default; + ResponseError error = default; + WidgetSuite result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new OperationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("result"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + result = WidgetSuite.DeserializeWidgetSuite(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceOperationStatusWidgetSuiteWidgetSuiteError(id, status, error, result, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceOperationStatusWidgetSuiteWidgetSuiteError)} does not support writing '{options.Format}' format."); + } + } + + ResourceOperationStatusWidgetSuiteWidgetSuiteError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResourceOperationStatusWidgetSuiteWidgetSuiteError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceOperationStatusWidgetSuiteWidgetSuiteError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ResourceOperationStatusWidgetSuiteWidgetSuiteError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeResourceOperationStatusWidgetSuiteWidgetSuiteError(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/ResourceOperationStatusWidgetSuiteWidgetSuiteError.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/ResourceOperationStatusWidgetSuiteWidgetSuiteError.cs new file mode 100644 index 000000000000..d2a07ed0b367 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/ResourceOperationStatusWidgetSuiteWidgetSuiteError.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Template.Contoso +{ + /// Provides status details for long running operations. + public partial class ResourceOperationStatusWidgetSuiteWidgetSuiteError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The unique ID of the operation. + /// The status of the operation. + /// is null. + internal ResourceOperationStatusWidgetSuiteWidgetSuiteError(string id, OperationState status) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + Status = status; + } + + /// Initializes a new instance of . + /// The unique ID of the operation. + /// The status of the operation. + /// Error object that describes the error when status is "Failed". + /// The result of the operation. + /// Keeps track of any properties unknown to the library. + internal ResourceOperationStatusWidgetSuiteWidgetSuiteError(string id, OperationState status, ResponseError error, WidgetSuite result, IDictionary serializedAdditionalRawData) + { + Id = id; + Status = status; + Error = error; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ResourceOperationStatusWidgetSuiteWidgetSuiteError() + { + } + + /// The unique ID of the operation. + public string Id { get; } + /// The status of the operation. + public OperationState Status { get; } + /// Error object that describes the error when status is "Failed". + public ResponseError Error { get; } + /// The result of the operation. + public WidgetSuite Result { get; } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/TemplateContosoClientBuilderExtensions.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/TemplateContosoClientBuilderExtensions.cs new file mode 100644 index 000000000000..747219bf50c0 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/TemplateContosoClientBuilderExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Extensions; +using Azure.Template.Contoso; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class TemplateContosoClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// The to use. + public static IAzureClientBuilder AddWidgetManagerClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new WidgetManagerClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddWidgetManagerClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/TemplateContosoModelFactory.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/TemplateContosoModelFactory.cs new file mode 100644 index 000000000000..1a64eda68bce --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/TemplateContosoModelFactory.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Template.Contoso +{ + /// Model factory for models. + public static partial class TemplateContosoModelFactory + { + /// Initializes a new instance of . + /// The widget name. + /// The ID of the widget's manufacturer. + /// The faked shared model. + /// A new instance for mocking. + public static WidgetSuite WidgetSuite(string name = null, string manufacturerId = null, FakedSharedModel sharedModel = null) + { + return new WidgetSuite(name, manufacturerId, sharedModel, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The unique ID of the operation. + /// The status of the operation. + /// Error object that describes the error when status is "Failed". + /// The result of the operation. + /// A new instance for mocking. + public static ResourceOperationStatusWidgetSuiteWidgetSuiteError ResourceOperationStatusWidgetSuiteWidgetSuiteError(string id = null, OperationState status = default, ResponseError error = null, WidgetSuite result = null) + { + return new ResourceOperationStatusWidgetSuiteWidgetSuiteError(id, status, error, result, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetManagerClient.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetManagerClient.cs new file mode 100644 index 000000000000..719c97afcfab --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetManagerClient.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Template.Contoso +{ + // Data plane generated client. + /// The WidgetManager service client. + public partial class WidgetManagerClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://contoso.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of WidgetManagerClient for mocking. + protected WidgetManagerClient() + { + } + + /// Initializes a new instance of WidgetManagerClient. + /// The to use. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public WidgetManagerClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new WidgetManagerClientOptions()) + { + } + + /// Initializes a new instance of WidgetManagerClient. + /// The to use. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public WidgetManagerClient(Uri endpoint, TokenCredential credential, WidgetManagerClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new WidgetManagerClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of Widgets. + /// The API version to use for this operation. + /// is null. + public virtual Widgets GetWidgetsClient(string apiVersion = "2022-11-01-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Widgets(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetManagerClientOptions.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetManagerClientOptions.cs new file mode 100644 index 000000000000..319247b6523e --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetManagerClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Template.Contoso +{ + /// Client options for WidgetManagerClient. + public partial class WidgetManagerClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2022_11_01_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2022-11-01-preview". + V2022_11_01_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of WidgetManagerClientOptions. + public WidgetManagerClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2022_11_01_Preview => "2022-11-01-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetSuite.Serialization.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetSuite.Serialization.cs new file mode 100644 index 000000000000..a55656f77402 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetSuite.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Template.Contoso +{ + public partial class WidgetSuite : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WidgetSuite)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WritePropertyName("manufacturerId"u8); + writer.WriteStringValue(ManufacturerId); + if (Optional.IsDefined(SharedModel)) + { + writer.WritePropertyName("sharedModel"u8); + writer.WriteObjectValue(SharedModel, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + WidgetSuite IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WidgetSuite)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWidgetSuite(document.RootElement, options); + } + + internal static WidgetSuite DeserializeWidgetSuite(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string manufacturerId = default; + FakedSharedModel sharedModel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("manufacturerId"u8)) + { + manufacturerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sharedModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sharedModel = FakedSharedModel.DeserializeFakedSharedModel(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WidgetSuite(name, manufacturerId, sharedModel, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WidgetSuite)} does not support writing '{options.Format}' format."); + } + } + + WidgetSuite IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWidgetSuite(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WidgetSuite)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static WidgetSuite FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWidgetSuite(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetSuite.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetSuite.cs new file mode 100644 index 000000000000..9ba44c829aa3 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/WidgetSuite.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Template.Contoso +{ + /// A widget. + public partial class WidgetSuite + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The ID of the widget's manufacturer. + /// is null. + public WidgetSuite(string manufacturerId) + { + Argument.AssertNotNull(manufacturerId, nameof(manufacturerId)); + + ManufacturerId = manufacturerId; + } + + /// Initializes a new instance of . + /// The widget name. + /// The ID of the widget's manufacturer. + /// The faked shared model. + /// Keeps track of any properties unknown to the library. + internal WidgetSuite(string name, string manufacturerId, FakedSharedModel sharedModel, IDictionary serializedAdditionalRawData) + { + Name = name; + ManufacturerId = manufacturerId; + SharedModel = sharedModel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WidgetSuite() + { + } + + /// The widget name. + public string Name { get; } + /// The ID of the widget's manufacturer. + public string ManufacturerId { get; set; } + /// The faked shared model. + public FakedSharedModel SharedModel { get; set; } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Widgets.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Widgets.cs new file mode 100644 index 000000000000..525b6e13b008 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Generated/Widgets.cs @@ -0,0 +1,667 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Template.Contoso +{ + // Data plane generated sub-client. + /// The Widgets sub-client. + public partial class Widgets + { + private static readonly string[] AuthorizationScopes = new string[] { "https://contoso.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of Widgets for mocking. + protected Widgets() + { + } + + /// Initializes a new instance of Widgets. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// The to use. + /// The API version to use for this operation. + internal Widgets(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Fetch a Widget by name. + /// The widget name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetWidgetAsync(string widgetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetWidgetAsync(widgetName, context).ConfigureAwait(false); + return Response.FromValue(WidgetSuite.FromResponse(response), response); + } + + /// Fetch a Widget by name. + /// The widget name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetWidget(string widgetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetWidget(widgetName, context); + return Response.FromValue(WidgetSuite.FromResponse(response), response); + } + + /// + /// [Protocol Method] Fetch a Widget by name. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The widget name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetWidgetAsync(string widgetName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + + using var scope = ClientDiagnostics.CreateScope("Widgets.GetWidget"); + scope.Start(); + try + { + using HttpMessage message = CreateGetWidgetRequest(widgetName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Fetch a Widget by name. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The widget name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetWidget(string widgetName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + + using var scope = ClientDiagnostics.CreateScope("Widgets.GetWidget"); + scope.Start(); + try + { + using HttpMessage message = CreateGetWidgetRequest(widgetName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets status of a Widget operation. + /// The widget name. + /// The unique ID of the operation. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetWidgetOperationStatusAsync(string widgetName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetWidgetOperationStatusAsync(widgetName, operationId, context).ConfigureAwait(false); + return Response.FromValue(ResourceOperationStatusWidgetSuiteWidgetSuiteError.FromResponse(response), response); + } + + /// Gets status of a Widget operation. + /// The widget name. + /// The unique ID of the operation. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetWidgetOperationStatus(string widgetName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetWidgetOperationStatus(widgetName, operationId, context); + return Response.FromValue(ResourceOperationStatusWidgetSuiteWidgetSuiteError.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets status of a Widget operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The widget name. + /// The unique ID of the operation. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetWidgetOperationStatusAsync(string widgetName, string operationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = ClientDiagnostics.CreateScope("Widgets.GetWidgetOperationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetWidgetOperationStatusRequest(widgetName, operationId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets status of a Widget operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The widget name. + /// The unique ID of the operation. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetWidgetOperationStatus(string widgetName, string operationId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = ClientDiagnostics.CreateScope("Widgets.GetWidgetOperationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetWidgetOperationStatusRequest(widgetName, operationId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// List Widget resources. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetWidgetsAsync(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetWidgetsRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetWidgetsNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => WidgetSuite.DeserializeWidgetSuite(e), ClientDiagnostics, _pipeline, "Widgets.GetWidgets", "value", "nextLink", context); + } + + /// List Widget resources. + /// The cancellation token to use. + /// + public virtual Pageable GetWidgets(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetWidgetsRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetWidgetsNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => WidgetSuite.DeserializeWidgetSuite(e), ClientDiagnostics, _pipeline, "Widgets.GetWidgets", "value", "nextLink", context); + } + + /// + /// [Protocol Method] List Widget resources + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetWidgetsAsync(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetWidgetsRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetWidgetsNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Widgets.GetWidgets", "value", "nextLink", context); + } + + /// + /// [Protocol Method] List Widget resources + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetWidgets(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetWidgetsRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetWidgetsNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Widgets.GetWidgets", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Creates or updates a Widget asynchronously. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The widget name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task> CreateOrUpdateWidgetAsync(WaitUntil waitUntil, string widgetName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Widgets.CreateOrUpdateWidget"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateWidgetRequest(widgetName, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "Widgets.CreateOrUpdateWidget", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates or updates a Widget asynchronously. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The widget name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation CreateOrUpdateWidget(WaitUntil waitUntil, string widgetName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Widgets.CreateOrUpdateWidget"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateWidgetRequest(widgetName, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "Widgets.CreateOrUpdateWidget", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Delete a Widget asynchronously. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The widget name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> DeleteWidgetAsync(WaitUntil waitUntil, string widgetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await DeleteWidgetAsync(waitUntil, widgetName, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchWidgetSuiteFromResourceOperationStatusWidgetSuiteWidgetSuiteError, ClientDiagnostics, "Widgets.DeleteWidget"); + } + + /// Delete a Widget asynchronously. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The widget name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation DeleteWidget(WaitUntil waitUntil, string widgetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = DeleteWidget(waitUntil, widgetName, context); + return ProtocolOperationHelpers.Convert(response, FetchWidgetSuiteFromResourceOperationStatusWidgetSuiteWidgetSuiteError, ClientDiagnostics, "Widgets.DeleteWidget"); + } + + /// + /// [Protocol Method] Delete a Widget asynchronously. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The widget name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task> DeleteWidgetAsync(WaitUntil waitUntil, string widgetName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + + using var scope = ClientDiagnostics.CreateScope("Widgets.DeleteWidget"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteWidgetRequest(widgetName, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "Widgets.DeleteWidget", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Delete a Widget asynchronously. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The widget name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation DeleteWidget(WaitUntil waitUntil, string widgetName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(widgetName, nameof(widgetName)); + + using var scope = ClientDiagnostics.CreateScope("Widgets.DeleteWidget"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteWidgetRequest(widgetName, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "Widgets.DeleteWidget", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetWidgetRequest(string widgetName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/widgets/", false); + uri.AppendPath(widgetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetWidgetOperationStatusRequest(string widgetName, string operationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/widgets/", false); + uri.AppendPath(widgetName, true); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateWidgetRequest(string widgetName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/widgets/", false); + uri.AppendPath(widgetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/merge-patch+json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteWidgetRequest(string widgetName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/widgets/", false); + uri.AppendPath(widgetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetWidgetsRequest(RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/widgets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetWidgetsNextPageRequest(string nextLink, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + + private WidgetSuite FetchWidgetSuiteFromResourceOperationStatusWidgetSuiteWidgetSuiteError(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return WidgetSuite.DeserializeWidgetSuite(resultJsonElement); + } + + private WidgetSuite FetchWidgetSuiteFromResourceOperationStatusWidgetSuiteWidgetSuiteError(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return WidgetSuite.DeserializeWidgetSuite(resultJsonElement); + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Properties/AssemblyInfo.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..aa9fd891b234 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Template.Contoso.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/tests/Azure.Template.Contoso.Tests.csproj b/sdk/contosowidgetmanager/Azure.Template.Contoso/tests/Azure.Template.Contoso.Tests.csproj new file mode 100644 index 000000000000..9b79d892421f --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/tests/Azure.Template.Contoso.Tests.csproj @@ -0,0 +1,20 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/tests/Generated/Samples/Samples_Widgets.cs b/sdk/contosowidgetmanager/Azure.Template.Contoso/tests/Generated/Samples/Samples_Widgets.cs new file mode 100644 index 000000000000..11562c2829ee --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/tests/Generated/Samples/Samples_Widgets.cs @@ -0,0 +1,577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Template.Contoso.Samples +{ + public partial class Samples_Widgets + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_GetWidget_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = client.GetWidget("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_GetWidget_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = await client.GetWidgetAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_GetWidget_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = client.GetWidget(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_GetWidget_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = await client.GetWidgetAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_GetWidget_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = client.GetWidget("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_GetWidget_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = await client.GetWidgetAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_GetWidget_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = client.GetWidget(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_GetWidget_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = await client.GetWidgetAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ResourceOperationStatus_GetWidgetOperationStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = client.GetWidgetOperationStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ResourceOperationStatus_GetWidgetOperationStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = await client.GetWidgetOperationStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ResourceOperationStatus_GetWidgetOperationStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = client.GetWidgetOperationStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ResourceOperationStatus_GetWidgetOperationStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = await client.GetWidgetOperationStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ResourceOperationStatus_GetWidgetOperationStatus_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = client.GetWidgetOperationStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ResourceOperationStatus_GetWidgetOperationStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = await client.GetWidgetOperationStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ResourceOperationStatus_GetWidgetOperationStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = client.GetWidgetOperationStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ResourceOperationStatus_GetWidgetOperationStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Response response = await client.GetWidgetOperationStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_GetWidgets_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + foreach (BinaryData item in client.GetWidgets(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_GetWidgets_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + await foreach (BinaryData item in client.GetWidgetsAsync(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_GetWidgets_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + foreach (WidgetSuite item in client.GetWidgets()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_GetWidgets_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + await foreach (WidgetSuite item in client.GetWidgetsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_GetWidgets_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + foreach (BinaryData item in client.GetWidgets(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_GetWidgets_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + await foreach (BinaryData item in client.GetWidgetsAsync(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_GetWidgets_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + foreach (WidgetSuite item in client.GetWidgets()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_GetWidgets_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + await foreach (WidgetSuite item in client.GetWidgetsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_CreateOrUpdateWidget_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + using RequestContent content = RequestContent.Create(new + { + manufacturerId = "", + }); + Operation operation = client.CreateOrUpdateWidget(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_CreateOrUpdateWidget_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + using RequestContent content = RequestContent.Create(new + { + manufacturerId = "", + }); + Operation operation = await client.CreateOrUpdateWidgetAsync(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_CreateOrUpdateWidget_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + using RequestContent content = RequestContent.Create(new + { + manufacturerId = "", + sharedModel = new + { + tag = "", + createdAt = "2022-05-10T18:57:31.2311892Z", + }, + }); + Operation operation = client.CreateOrUpdateWidget(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_CreateOrUpdateWidget_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + using RequestContent content = RequestContent.Create(new + { + manufacturerId = "", + sharedModel = new + { + tag = "", + createdAt = "2022-05-10T18:57:31.2311892Z", + }, + }); + Operation operation = await client.CreateOrUpdateWidgetAsync(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_DeleteWidget_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Operation operation = client.DeleteWidget(WaitUntil.Completed, "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_DeleteWidget_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Operation operation = await client.DeleteWidgetAsync(WaitUntil.Completed, "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_DeleteWidget_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Operation operation = client.DeleteWidget(WaitUntil.Completed, ""); + WidgetSuite responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_DeleteWidget_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Operation operation = await client.DeleteWidgetAsync(WaitUntil.Completed, ""); + WidgetSuite responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_DeleteWidget_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Operation operation = client.DeleteWidget(WaitUntil.Completed, "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_DeleteWidget_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Operation operation = await client.DeleteWidgetAsync(WaitUntil.Completed, "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("manufacturerId").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("tag").ToString()); + Console.WriteLine(result.GetProperty("sharedModel").GetProperty("createdAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_WidgetSuite_DeleteWidget_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Operation operation = client.DeleteWidget(WaitUntil.Completed, ""); + WidgetSuite responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_WidgetSuite_DeleteWidget_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Widgets client = new WidgetManagerClient(endpoint, credential).GetWidgetsClient(apiVersion: "2022-11-01-preview"); + + Operation operation = await client.DeleteWidgetAsync(WaitUntil.Completed, ""); + WidgetSuite responseData = operation.Value; + } + } +} diff --git a/sdk/contosowidgetmanager/Azure.Template.Contoso/tsp-location.yaml b/sdk/contosowidgetmanager/Azure.Template.Contoso/tsp-location.yaml new file mode 100644 index 000000000000..80217aa34aa3 --- /dev/null +++ b/sdk/contosowidgetmanager/Azure.Template.Contoso/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/contosowidgetmanager/Contoso.WidgetManager +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: +- specification/contosowidgetmanager/Contoso.WidgetManager.Shared diff --git a/sdk/contosowidgetmanager/ci.yml b/sdk/contosowidgetmanager/ci.yml new file mode 100644 index 000000000000..7f76decbce9e --- /dev/null +++ b/sdk/contosowidgetmanager/ci.yml @@ -0,0 +1,35 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/contosowidgetmanager + - sdk/contosowidgetmanager/ci.yml + - sdk/contosowidgetmanager/Azure.Template.Contoso + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/contosowidgetmanager + - sdk/contosowidgetmanager/ci.yml + - sdk/contosowidgetmanager/Azure.Template.Contoso + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: contosowidgetmanager + ArtifactName: packages + Artifacts: + - name: Azure.Template.Contoso + safeName: AzureTemplateContoso diff --git a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DeploymentEnvironmentsClient.cs b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DeploymentEnvironmentsClient.cs index cc35748b809f..c22ac63469a0 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DeploymentEnvironmentsClient.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DeploymentEnvironmentsClient.cs @@ -101,7 +101,7 @@ public virtual Response GetEnvironment(string projectName, } /// - /// [Protocol Method] Gets an environment + /// [Protocol Method] Gets an environment. /// /// /// @@ -145,7 +145,7 @@ public virtual async Task GetEnvironmentAsync(string projectName, stri } /// - /// [Protocol Method] Gets an environment + /// [Protocol Method] Gets an environment. /// /// /// @@ -223,7 +223,7 @@ public virtual Response GetCatalog(string projectName, string } /// - /// [Protocol Method] Gets the specified catalog within the project + /// [Protocol Method] Gets the specified catalog within the project. /// /// /// @@ -265,7 +265,7 @@ public virtual async Task GetCatalogAsync(string projectName, string c } /// - /// [Protocol Method] Gets the specified catalog within the project + /// [Protocol Method] Gets the specified catalog within the project. /// /// /// @@ -919,7 +919,7 @@ public virtual Pageable GetEnvironmentDefinitionsByCatalog(string pr } /// Lists all environment types configured for a project. - /// The DevCenter Project upon which to execute operations. + /// Name of the project. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -935,7 +935,7 @@ public virtual AsyncPageable GetEnvironmentTypesAsync( } /// Lists all environment types configured for a project. - /// The DevCenter Project upon which to execute operations. + /// Name of the project. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -965,7 +965,7 @@ public virtual Pageable GetEnvironmentTypes(string pro /// /// /// - /// The DevCenter Project upon which to execute operations. + /// Name of the project. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. @@ -996,7 +996,7 @@ public virtual AsyncPageable GetEnvironmentTypesAsync(string project /// /// /// - /// The DevCenter Project upon which to execute operations. + /// Name of the project. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DevBoxesClient.cs b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DevBoxesClient.cs index e657c7524da0..fc0d4bb47cd3 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DevBoxesClient.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DevBoxesClient.cs @@ -97,7 +97,7 @@ public virtual Response GetPool(string projectName, string poolName, } /// - /// [Protocol Method] Gets a pool + /// [Protocol Method] Gets a pool. /// /// /// @@ -139,7 +139,7 @@ public virtual async Task GetPoolAsync(string projectName, string pool } /// - /// [Protocol Method] Gets a pool + /// [Protocol Method] Gets a pool. /// /// /// @@ -345,7 +345,7 @@ public virtual Response GetDevBox(string projectName, string userId, str } /// - /// [Protocol Method] Gets a Dev Box + /// [Protocol Method] Gets a Dev Box. /// /// /// @@ -389,7 +389,7 @@ public virtual async Task GetDevBoxAsync(string projectName, string us } /// - /// [Protocol Method] Gets a Dev Box + /// [Protocol Method] Gets a Dev Box. /// /// /// @@ -471,7 +471,7 @@ public virtual Response GetRemoteConnection(string projectName } /// - /// [Protocol Method] Gets RDP Connection info + /// [Protocol Method] Gets RDP Connection info. /// /// /// @@ -515,7 +515,7 @@ public virtual async Task GetRemoteConnectionAsync(string projectName, } /// - /// [Protocol Method] Gets RDP Connection info + /// [Protocol Method] Gets RDP Connection info. /// /// /// @@ -947,7 +947,7 @@ public virtual Pageable GetPools(string projectName, CancellationTok } /// - /// [Protocol Method] Lists available pools + /// [Protocol Method] Lists available pools. /// /// /// @@ -978,7 +978,7 @@ public virtual AsyncPageable GetPoolsAsync(string projectName, Reque } /// - /// [Protocol Method] Lists available pools + /// [Protocol Method] Lists available pools. /// /// /// @@ -1008,9 +1008,9 @@ public virtual Pageable GetPools(string projectName, RequestContext return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DevBoxesClient.GetPools", "value", "nextLink", context); } - /// Lists available schedules for a pool. - /// Name of the project. - /// Pool name. + /// Lists all schedules within a pool that are configured by your project administrator. + /// The DevCenter Project upon which to execute operations. + /// The name of a pool of Dev Boxes. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -1026,9 +1026,9 @@ public virtual AsyncPageable GetSchedulesAsync(string projectNam return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DevBoxSchedule.DeserializeDevBoxSchedule(e), ClientDiagnostics, _pipeline, "DevBoxesClient.GetSchedules", "value", "nextLink", context); } - /// Lists available schedules for a pool. - /// Name of the project. - /// Pool name. + /// Lists all schedules within a pool that are configured by your project administrator. + /// The DevCenter Project upon which to execute operations. + /// The name of a pool of Dev Boxes. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -1045,7 +1045,7 @@ public virtual Pageable GetSchedules(string projectName, string } /// - /// [Protocol Method] Lists available schedules for a pool. + /// [Protocol Method] Lists all schedules within a pool that are configured by your project administrator. /// /// /// @@ -1059,8 +1059,8 @@ public virtual Pageable GetSchedules(string projectName, string /// /// /// - /// Name of the project. - /// Pool name. + /// The DevCenter Project upon which to execute operations. + /// The name of a pool of Dev Boxes. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -1078,7 +1078,7 @@ public virtual AsyncPageable GetSchedulesAsync(string projectName, s } /// - /// [Protocol Method] Lists available schedules for a pool. + /// [Protocol Method] Lists all schedules within a pool that are configured by your project administrator. /// /// /// @@ -1092,8 +1092,8 @@ public virtual AsyncPageable GetSchedulesAsync(string projectName, s /// /// /// - /// Name of the project. - /// Pool name. + /// The DevCenter Project upon which to execute operations. + /// The name of a pool of Dev Boxes. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -1772,7 +1772,7 @@ public virtual Operation DeleteDevBox(WaitUntil waitUntil, string projectName, s // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Starts a Dev Box + /// [Protocol Method] Starts a Dev Box. /// /// /// @@ -1813,7 +1813,7 @@ public virtual async Task StartDevBoxAsync(WaitUntil waitUntil, strin // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Starts a Dev Box + /// [Protocol Method] Starts a Dev Box. /// /// /// @@ -1854,7 +1854,7 @@ public virtual Operation StartDevBox(WaitUntil waitUntil, string projectName, st // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Stops a Dev Box + /// [Protocol Method] Stops a Dev Box. /// /// /// @@ -1896,7 +1896,7 @@ public virtual async Task StopDevBoxAsync(WaitUntil waitUntil, string // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Stops a Dev Box + /// [Protocol Method] Stops a Dev Box. /// /// /// @@ -1938,7 +1938,7 @@ public virtual Operation StopDevBox(WaitUntil waitUntil, string projectName, str // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Restarts a Dev Box + /// [Protocol Method] Restarts a Dev Box. /// /// /// @@ -1979,7 +1979,7 @@ public virtual async Task RestartDevBoxAsync(WaitUntil waitUntil, str // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Restarts a Dev Box + /// [Protocol Method] Restarts a Dev Box. /// /// /// diff --git a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DevCenterModelFactory.cs b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DevCenterModelFactory.cs index ee046a85e234..d736e06de399 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DevCenterModelFactory.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/DevCenterModelFactory.cs @@ -28,54 +28,37 @@ public static DevCenterProject DevCenterProject(string name = null, string descr return new DevCenterProject(name, description, maxDevBoxesPerUser, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Display name for the Dev Box. - /// Name of the project this Dev Box belongs to. - /// The name of the Dev Box pool this machine belongs to. + /// Initializes a new instance of . + /// Pool name. + /// Azure region where Dev Boxes in the pool are located. + /// The operating system type of Dev Boxes in this pool. + /// Hardware settings for the Dev Boxes created in this pool. /// Indicates whether hibernate is enabled/disabled or unknown. - /// The current provisioning state of the Dev Box. - /// - /// The current action state of the Dev Box. This is state is based on previous - /// action performed by user. - /// - /// The current power state of the Dev Box. - /// - /// A unique identifier for the Dev Box. This is a GUID-formatted string (e.g. - /// 00000000-0000-0000-0000-000000000000). + /// Storage settings for Dev Box created in this pool. + /// Image settings for Dev Boxes create in this pool. + /// + /// Indicates whether owners of Dev Boxes in this pool are local administrators on + /// the Dev Boxes. /// - /// Provisioning or action error details. Populated only for error states. - /// - /// Azure region where this Dev Box is located. This will be the same region as the - /// Virtual Network it is attached to. + /// Stop on disconnect configuration settings for Dev Boxes created in this pool. + /// + /// Overall health status of the Pool. Indicates whether or not the Pool is + /// available to create Dev Boxes. /// - /// The operating system type of this Dev Box. - /// The AAD object id of the user this Dev Box is assigned to. - /// Information about the Dev Box's hardware resources. - /// Storage settings for this Dev Box. - /// Information about the image used for this Dev Box. - /// Creation time of this Dev Box. - /// Indicates whether the owner of the Dev Box is a local administrator. - /// A new instance for mocking. - public static DevBox DevBox(string name = null, string projectName = null, string poolName = null, HibernateSupport? hibernateSupport = null, DevBoxProvisioningState? provisioningState = null, string actionState = null, PowerState? powerState = null, Guid? uniqueId = null, ResponseError error = null, AzureLocation? location = null, DevBoxOSType? osType = null, Guid? userId = null, DevBoxHardwareProfile hardwareProfile = null, DevBoxStorageProfile storageProfile = null, DevBoxImageReference imageReference = null, DateTimeOffset? createdTime = null, LocalAdministratorStatus? localAdministratorStatus = null) + /// A new instance for mocking. + public static DevBoxPool DevBoxPool(string name = null, AzureLocation location = default, DevBoxOSType? osType = null, DevBoxHardwareProfile hardwareProfile = null, HibernateSupport? hibernateSupport = null, DevBoxStorageProfile storageProfile = null, DevBoxImageReference imageReference = null, LocalAdministratorStatus? localAdministratorStatus = null, StopOnDisconnectConfiguration stopOnDisconnect = null, PoolHealthStatus healthStatus = default) { - return new DevBox( + return new DevBoxPool( name, - projectName, - poolName, - hibernateSupport, - provisioningState, - actionState, - powerState, - uniqueId, - error, location, osType, - userId, hardwareProfile, + hibernateSupport, storageProfile, imageReference, - createdTime, localAdministratorStatus, + stopOnDisconnect, + healthStatus, serializedAdditionalRawData: null); } @@ -123,40 +106,6 @@ public static DevBoxImageReference DevBoxImageReference(string name = null, stri serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Pool name. - /// Azure region where Dev Boxes in the pool are located. - /// The operating system type of Dev Boxes in this pool. - /// Hardware settings for the Dev Boxes created in this pool. - /// Indicates whether hibernate is enabled/disabled or unknown. - /// Storage settings for Dev Box created in this pool. - /// Image settings for Dev Boxes create in this pool. - /// - /// Indicates whether owners of Dev Boxes in this pool are local administrators on - /// the Dev Boxes. - /// - /// Stop on disconnect configuration settings for Dev Boxes created in this pool. - /// - /// Overall health status of the Pool. Indicates whether or not the Pool is - /// available to create Dev Boxes. - /// - /// A new instance for mocking. - public static DevBoxPool DevBoxPool(string name = null, AzureLocation location = default, DevBoxOSType? osType = null, DevBoxHardwareProfile hardwareProfile = null, HibernateSupport? hibernateSupport = null, DevBoxStorageProfile storageProfile = null, DevBoxImageReference imageReference = null, LocalAdministratorStatus? localAdministratorStatus = null, StopOnDisconnectConfiguration stopOnDisconnect = null, PoolHealthStatus healthStatus = default) - { - return new DevBoxPool( - name, - location, - osType, - hardwareProfile, - hibernateSupport, - storageProfile, - imageReference, - localAdministratorStatus, - stopOnDisconnect, - healthStatus, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// /// Indicates whether the feature to stop the devbox on disconnect once the grace @@ -172,6 +121,57 @@ public static StopOnDisconnectConfiguration StopOnDisconnectConfiguration(StopOn return new StopOnDisconnectConfiguration(status, gracePeriodMinutes, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Display name for the Dev Box. + /// Name of the project this Dev Box belongs to. + /// The name of the Dev Box pool this machine belongs to. + /// Indicates whether hibernate is enabled/disabled or unknown. + /// The current provisioning state of the Dev Box. + /// + /// The current action state of the Dev Box. This is state is based on previous + /// action performed by user. + /// + /// The current power state of the Dev Box. + /// + /// A unique identifier for the Dev Box. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000). + /// + /// Provisioning or action error details. Populated only for error states. + /// + /// Azure region where this Dev Box is located. This will be the same region as the + /// Virtual Network it is attached to. + /// + /// The operating system type of this Dev Box. + /// The AAD object id of the user this Dev Box is assigned to. + /// Information about the Dev Box's hardware resources. + /// Storage settings for this Dev Box. + /// Information about the image used for this Dev Box. + /// Creation time of this Dev Box. + /// Indicates whether the owner of the Dev Box is a local administrator. + /// A new instance for mocking. + public static DevBox DevBox(string name = null, string projectName = null, string poolName = null, HibernateSupport? hibernateSupport = null, DevBoxProvisioningState? provisioningState = null, string actionState = null, PowerState? powerState = null, Guid? uniqueId = null, ResponseError error = null, AzureLocation? location = null, DevBoxOSType? osType = null, Guid? userId = null, DevBoxHardwareProfile hardwareProfile = null, DevBoxStorageProfile storageProfile = null, DevBoxImageReference imageReference = null, DateTimeOffset? createdTime = null, LocalAdministratorStatus? localAdministratorStatus = null) + { + return new DevBox( + name, + projectName, + poolName, + hibernateSupport, + provisioningState, + actionState, + powerState, + uniqueId, + error, + location, + osType, + userId, + hardwareProfile, + storageProfile, + imageReference, + createdTime, + localAdministratorStatus, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Display name for the Schedule. /// Supported type this scheduled task represents. @@ -190,6 +190,14 @@ public static DevBoxSchedule DevBoxSchedule(string name = null, ScheduleType sch serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Name of the catalog. + /// A new instance for mocking. + public static DevCenterCatalog DevCenterCatalog(string name = null) + { + return new DevCenterCatalog(name, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// URL to open a browser based RDP session. /// Link to open a Remote Desktop session. @@ -264,14 +272,6 @@ public static DevCenterEnvironment DevCenterEnvironment(IDictionary Initializes a new instance of . - /// Name of the catalog. - /// A new instance for mocking. - public static DevCenterCatalog DevCenterCatalog(string name = null) - { - return new DevCenterCatalog(name, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The ID of the environment definition. /// Name of the environment definition. @@ -303,7 +303,7 @@ public static EnvironmentDefinition EnvironmentDefinition(string id = null, stri /// Default value of the parameter. /// /// A string of one of the basic JSON types (number, integer, array, object, - /// boolean, string) + /// boolean, string). /// /// /// Whether or not this parameter is read-only. If true, default should have a diff --git a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/DevCenterEnvironmentType.Serialization.cs b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/DevCenterEnvironmentType.Serialization.cs index f17dca7b2f2c..946d4baac90b 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/DevCenterEnvironmentType.Serialization.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/DevCenterEnvironmentType.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } writer.WritePropertyName("deploymentTargetId"u8); writer.WriteStringValue(DeploymentTargetId); writer.WritePropertyName("status"u8); diff --git a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/DevCenterEnvironmentType.cs b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/DevCenterEnvironmentType.cs index a9d9a7bb8d38..7ab4e428ebf5 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/DevCenterEnvironmentType.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/DevCenterEnvironmentType.cs @@ -47,20 +47,17 @@ public partial class DevCenterEnvironmentType private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the environment type. /// /// Id of a subscription or management group that the environment type will be /// mapped to. The environment's resources will be deployed into this subscription /// or management group. /// /// Indicates whether this environment type is enabled for use in this project. - /// or is null. - internal DevCenterEnvironmentType(string name, ResourceIdentifier deploymentTargetId, EnvironmentTypeStatus status) + /// is null. + internal DevCenterEnvironmentType(ResourceIdentifier deploymentTargetId, EnvironmentTypeStatus status) { - Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(deploymentTargetId, nameof(deploymentTargetId)); - Name = name; DeploymentTargetId = deploymentTargetId; Status = status; } diff --git a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/EnvironmentDefinitionParameter.cs b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/EnvironmentDefinitionParameter.cs index c67ea98e4a76..22fe93a82fe5 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/EnvironmentDefinitionParameter.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/src/Generated/Models/EnvironmentDefinitionParameter.cs @@ -49,7 +49,7 @@ public partial class EnvironmentDefinitionParameter /// Unique ID of the parameter. /// /// A string of one of the basic JSON types (number, integer, array, object, - /// boolean, string) + /// boolean, string). /// /// Whether or not this parameter is required. /// is null. @@ -70,7 +70,7 @@ internal EnvironmentDefinitionParameter(string id, EnvironmentDefinitionParamete /// Default value of the parameter. /// /// A string of one of the basic JSON types (number, integer, array, object, - /// boolean, string) + /// boolean, string). /// /// /// Whether or not this parameter is read-only. If true, default should have a @@ -107,7 +107,7 @@ internal EnvironmentDefinitionParameter() public string DefaultValue { get; } /// /// A string of one of the basic JSON types (number, integer, array, object, - /// boolean, string) + /// boolean, string). /// public EnvironmentDefinitionParameterType ParameterType { get; } /// diff --git a/sdk/devcenter/Azure.Developer.DevCenter/tests/Generated/Samples/Samples_DeploymentEnvironmentsClient.cs b/sdk/devcenter/Azure.Developer.DevCenter/tests/Generated/Samples/Samples_DeploymentEnvironmentsClient.cs index 6a10ecb302d2..2399dc481f3b 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/tests/Generated/Samples/Samples_DeploymentEnvironmentsClient.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/tests/Generated/Samples/Samples_DeploymentEnvironmentsClient.cs @@ -1053,7 +1053,7 @@ public async Task Example_EnvironmentClientOperations_GetEnvironmentDefinitionsB [Test] [Ignore("Only validating compilation of examples")] - public void Example_EnvironmentClientOperations_GetEnvironmentTypes_ShortVersion() + public void Example_EnvironmentType_GetEnvironmentTypes_ShortVersion() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1070,7 +1070,7 @@ public void Example_EnvironmentClientOperations_GetEnvironmentTypes_ShortVersion [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EnvironmentClientOperations_GetEnvironmentTypes_ShortVersion_Async() + public async Task Example_EnvironmentType_GetEnvironmentTypes_ShortVersion_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1087,7 +1087,7 @@ public async Task Example_EnvironmentClientOperations_GetEnvironmentTypes_ShortV [Test] [Ignore("Only validating compilation of examples")] - public void Example_EnvironmentClientOperations_GetEnvironmentTypes_ShortVersion_Convenience() + public void Example_EnvironmentType_GetEnvironmentTypes_ShortVersion_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1100,7 +1100,7 @@ public void Example_EnvironmentClientOperations_GetEnvironmentTypes_ShortVersion [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EnvironmentClientOperations_GetEnvironmentTypes_ShortVersion_Convenience_Async() + public async Task Example_EnvironmentType_GetEnvironmentTypes_ShortVersion_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1113,7 +1113,7 @@ public async Task Example_EnvironmentClientOperations_GetEnvironmentTypes_ShortV [Test] [Ignore("Only validating compilation of examples")] - public void Example_EnvironmentClientOperations_GetEnvironmentTypes_AllParameters() + public void Example_EnvironmentType_GetEnvironmentTypes_AllParameters() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1130,7 +1130,7 @@ public void Example_EnvironmentClientOperations_GetEnvironmentTypes_AllParameter [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EnvironmentClientOperations_GetEnvironmentTypes_AllParameters_Async() + public async Task Example_EnvironmentType_GetEnvironmentTypes_AllParameters_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1147,7 +1147,7 @@ public async Task Example_EnvironmentClientOperations_GetEnvironmentTypes_AllPar [Test] [Ignore("Only validating compilation of examples")] - public void Example_EnvironmentClientOperations_GetEnvironmentTypes_AllParameters_Convenience() + public void Example_EnvironmentType_GetEnvironmentTypes_AllParameters_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1160,7 +1160,7 @@ public void Example_EnvironmentClientOperations_GetEnvironmentTypes_AllParameter [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EnvironmentClientOperations_GetEnvironmentTypes_AllParameters_Convenience_Async() + public async Task Example_EnvironmentType_GetEnvironmentTypes_AllParameters_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); diff --git a/sdk/devcenter/Azure.Developer.DevCenter/tests/Generated/Samples/Samples_DevBoxesClient.cs b/sdk/devcenter/Azure.Developer.DevCenter/tests/Generated/Samples/Samples_DevBoxesClient.cs index 01097d8085b6..b5634f5f12be 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/tests/Generated/Samples/Samples_DevBoxesClient.cs +++ b/sdk/devcenter/Azure.Developer.DevCenter/tests/Generated/Samples/Samples_DevBoxesClient.cs @@ -949,7 +949,7 @@ public async Task Example_Pool_GetPools_AllParameters_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Schedule_GetSchedules_ShortVersion() + public void Example_DevBoxesClientOperations_GetSchedules_ShortVersion() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -968,7 +968,7 @@ public void Example_Schedule_GetSchedules_ShortVersion() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Schedule_GetSchedules_ShortVersion_Async() + public async Task Example_DevBoxesClientOperations_GetSchedules_ShortVersion_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -987,7 +987,7 @@ public async Task Example_Schedule_GetSchedules_ShortVersion_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Schedule_GetSchedules_ShortVersion_Convenience() + public void Example_DevBoxesClientOperations_GetSchedules_ShortVersion_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1000,7 +1000,7 @@ public void Example_Schedule_GetSchedules_ShortVersion_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Schedule_GetSchedules_ShortVersion_Convenience_Async() + public async Task Example_DevBoxesClientOperations_GetSchedules_ShortVersion_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1013,7 +1013,7 @@ public async Task Example_Schedule_GetSchedules_ShortVersion_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Schedule_GetSchedules_AllParameters() + public void Example_DevBoxesClientOperations_GetSchedules_AllParameters() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1032,7 +1032,7 @@ public void Example_Schedule_GetSchedules_AllParameters() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Schedule_GetSchedules_AllParameters_Async() + public async Task Example_DevBoxesClientOperations_GetSchedules_AllParameters_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1051,7 +1051,7 @@ public async Task Example_Schedule_GetSchedules_AllParameters_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Schedule_GetSchedules_AllParameters_Convenience() + public void Example_DevBoxesClientOperations_GetSchedules_AllParameters_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1064,7 +1064,7 @@ public void Example_Schedule_GetSchedules_AllParameters_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Schedule_GetSchedules_AllParameters_Convenience_Async() + public async Task Example_DevBoxesClientOperations_GetSchedules_AllParameters_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); diff --git a/sdk/devcenter/Azure.Developer.DevCenter/tsp-location.yaml b/sdk/devcenter/Azure.Developer.DevCenter/tsp-location.yaml index c744b507b924..8ba6814c9e93 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/tsp-location.yaml +++ b/sdk/devcenter/Azure.Developer.DevCenter/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/devcenter/DevCenter -commit: 63dc797c014849ef0c5da7eb91197975efb6a474 -repo: Azure/azure-rest-api-specs -cleanup: false +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/developer-signing/Azure.Developer.Signing/tsp-location.yaml b/sdk/developer-signing/Azure.Developer.Signing/tsp-location.yaml new file mode 100644 index 000000000000..d0c2df991c43 --- /dev/null +++ b/sdk/developer-signing/Azure.Developer.Signing/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/developersigning/DeveloperSigning +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml index ec4d97f30e9b..cc8239342da0 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification/devopsinfrastructure -commit: 16d5475c14c0d620f59d186b5a8c94a06ee85da0 -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs index 307cbc84ebe2..3fce0537cb4c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs @@ -33,7 +33,7 @@ internal AcsChatEventInThreadBaseProperties() { } public partial class AcsChatMessageDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageDeletedEventData() { } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -43,7 +43,7 @@ internal AcsChatMessageDeletedEventData() { } public partial class AcsChatMessageDeletedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageDeletedInThreadEventData() { } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -53,7 +53,7 @@ internal AcsChatMessageDeletedInThreadEventData() { } public partial class AcsChatMessageEditedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEditedEventData() { } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -65,7 +65,7 @@ internal AcsChatMessageEditedEventData() { } public partial class AcsChatMessageEditedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEditedInThreadEventData() { } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -77,7 +77,7 @@ internal AcsChatMessageEditedInThreadEventData() { } public partial class AcsChatMessageEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEventBaseProperties() { } - public System.DateTimeOffset ComposeTime { get { throw null; } } + public System.DateTimeOffset? ComposeTime { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } public string SenderDisplayName { get { throw null; } } @@ -92,7 +92,7 @@ internal AcsChatMessageEventBaseProperties() { } public partial class AcsChatMessageEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEventInThreadBaseProperties() { } - public System.DateTimeOffset ComposeTime { get { throw null; } } + public System.DateTimeOffset? ComposeTime { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } public string SenderDisplayName { get { throw null; } } @@ -131,7 +131,7 @@ public partial class AcsChatParticipantAddedToThreadEventData : Azure.Messaging. internal AcsChatParticipantAddedToThreadEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel AddedByCommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } - public System.DateTimeOffset Time { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -144,7 +144,7 @@ public partial class AcsChatParticipantAddedToThreadWithUserEventData : Azure.Me internal AcsChatParticipantAddedToThreadWithUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel AddedByCommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } - public System.DateTimeOffset Time { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -156,7 +156,7 @@ public partial class AcsChatParticipantRemovedFromThreadEventData : Azure.Messag internal AcsChatParticipantRemovedFromThreadEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantRemoved { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset Time { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -169,7 +169,7 @@ public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : Azur internal AcsChatParticipantRemovedFromThreadWithUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantRemoved { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset Time { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -206,7 +206,7 @@ public partial class AcsChatThreadDeletedEventData : Azure.Messaging.EventGrid.S { internal AcsChatThreadDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -216,7 +216,7 @@ internal AcsChatThreadDeletedEventData() { } public partial class AcsChatThreadEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatThreadEventBaseProperties() { } - public System.DateTimeOffset CreateTime { get { throw null; } } + public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -227,7 +227,7 @@ internal AcsChatThreadEventBaseProperties() { } public partial class AcsChatThreadEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatThreadEventInThreadBaseProperties() { } - public System.DateTimeOffset CreateTime { get { throw null; } } + public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -251,7 +251,7 @@ public partial class AcsChatThreadPropertiesUpdatedEventData : Azure.Messaging.E { internal AcsChatThreadPropertiesUpdatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -264,7 +264,7 @@ public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : Azure.Mess { internal AcsChatThreadPropertiesUpdatedPerUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -277,7 +277,7 @@ public partial class AcsChatThreadWithUserDeletedEventData : Azure.Messaging.Eve { internal AcsChatThreadWithUserDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -287,12 +287,12 @@ internal AcsChatThreadWithUserDeletedEventData() { } public partial class AcsEmailDeliveryReportReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsEmailDeliveryReportReceivedEventData() { } - public System.DateTimeOffset DeliveryAttemptTimestamp { get { throw null; } } + public System.DateTimeOffset? DeliveryAttemptTimestamp { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails DeliveryStatusDetails { get { throw null; } } public string MessageId { get { throw null; } } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus Status { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? Status { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -334,12 +334,12 @@ internal AcsEmailDeliveryReportStatusDetails() { } public partial class AcsEmailEngagementTrackingReportReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsEmailEngagementTrackingReportReceivedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement Engagement { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? Engagement { get { throw null; } } public string EngagementContext { get { throw null; } } public string MessageId { get { throw null; } } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } - public System.DateTimeOffset UserActionTimestamp { get { throw null; } } + public System.DateTimeOffset? UserActionTimestamp { get { throw null; } } public string UserAgent { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -468,9 +468,9 @@ internal AcsMessageContext() { } public partial class AcsMessageDeliveryStatusUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsMessageDeliveryStatusUpdatedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind ChannelKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? ChannelKind { get { throw null; } } public string MessageId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus Status { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? Status { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -482,7 +482,7 @@ public partial class AcsMessageEventData : System.ClientModel.Primitives.IJsonMo internal AcsMessageEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError Error { get { throw null; } } public string From { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string To { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -506,7 +506,7 @@ public partial class AcsMessageInteractiveContent : System.ClientModel.Primitive internal AcsMessageInteractiveContent() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent ButtonReply { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent ListReply { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind ReplyKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? ReplyKind { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -571,11 +571,11 @@ internal AcsRecordingChunkInfoProperties() { } public partial class AcsRecordingFileStatusUpdatedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRecordingFileStatusUpdatedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType RecordingChannelKind { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.RecordingContentType RecordingContentType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType? RecordingChannelKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingContentType? RecordingContentType { get { throw null; } } public long? RecordingDurationMs { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType RecordingFormatType { get { throw null; } } - public System.DateTimeOffset RecordingStartTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType? RecordingFormatType { get { throw null; } } + public System.DateTimeOffset? RecordingStartTime { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties RecordingStorageInfo { get { throw null; } } public string SessionEndReason { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -738,10 +738,10 @@ public partial class AcsRouterJobReceivedEventData : Azure.Messaging.EventGrid.S { internal AcsRouterJobReceivedEventData() { } public string ClassificationPolicyId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus JobStatus { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? JobStatus { get { throw null; } } public int? Priority { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequestedWorkerSelectors { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -756,7 +756,7 @@ internal AcsRouterJobSchedulingFailedEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } public string FailureReason { get { throw null; } } public int? Priority { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -808,7 +808,7 @@ internal AcsRouterJobWaitingForActivationEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredAttachedWorkerSelectors { get { throw null; } } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } public int? Priority { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -954,11 +954,11 @@ internal AcsRouterWorkerOfferExpiredEventData() { } public partial class AcsRouterWorkerOfferIssuedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerOfferIssuedEventData() { } - public System.DateTimeOffset ExpiresOn { get { throw null; } } + public System.DateTimeOffset? ExpiresOn { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary JobLabels { get { throw null; } } public int? JobPriority { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary JobTags { get { throw null; } } - public System.DateTimeOffset OfferedOn { get { throw null; } } + public System.DateTimeOffset? OfferedOn { get { throw null; } } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } @@ -998,11 +998,11 @@ internal AcsRouterWorkerRegisteredEventData() { } public partial class AcsRouterWorkerSelector : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerSelector() { } - public System.DateTimeOffset ExpirationTime { get { throw null; } } + public System.DateTimeOffset? ExpirationTime { get { throw null; } } public string Key { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator LabelOperator { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? LabelOperator { get { throw null; } } public System.BinaryData LabelValue { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState SelectorState { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? SelectorState { get { throw null; } } public double TimeToLive { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1049,7 +1049,7 @@ public partial class AcsSmsDeliveryAttemptProperties : System.ClientModel.Primit internal AcsSmsDeliveryAttemptProperties() { } public int? SegmentsFailed { get { throw null; } } public int? SegmentsSucceeded { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1062,7 +1062,7 @@ internal AcsSmsDeliveryReportReceivedEventData() { } public System.Collections.Generic.IReadOnlyList DeliveryAttempts { get { throw null; } } public string DeliveryStatus { get { throw null; } } public string DeliveryStatusDetails { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string Tag { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1086,7 +1086,7 @@ public partial class AcsSmsReceivedEventData : Azure.Messaging.EventGrid.SystemE { internal AcsSmsReceivedEventData() { } public string Message { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1497,7 +1497,7 @@ internal AppConfigurationSnapshotModifiedEventData() { } public partial class AppEventTypeDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppEventTypeDetail() { } - public Azure.Messaging.EventGrid.SystemEvents.AppAction Action { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AppAction? Action { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1524,9 +1524,9 @@ internal AppEventTypeDetail() { } public partial class AppServicePlanEventTypeDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppServicePlanEventTypeDetail() { } - public Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction Action { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StampKind StampKind { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AsyncStatus Status { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? Action { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StampKind? StampKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? Status { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1722,7 +1722,7 @@ public partial class CommunicationIdentifierModel : System.ClientModel.Primitive { internal CommunicationIdentifierModel() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel CommunicationUser { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind Kind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind? Kind { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsApp { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUser { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumber { get { throw null; } } @@ -1771,7 +1771,7 @@ internal ContainerRegistryArtifactEventData() { } public string Id { get { throw null; } } public string Location { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget Target { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1843,7 +1843,7 @@ internal ContainerRegistryEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest Request { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource Source { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget Target { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1991,8 +1991,8 @@ public partial class DataBoxCopyCompletedEventData : System.ClientModel.Primitiv { internal DataBoxCopyCompletedEventData() { } public string SerialNumber { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName StageName { get { throw null; } } - public System.DateTimeOffset StageTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2003,8 +2003,8 @@ public partial class DataBoxCopyStartedEventData : System.ClientModel.Primitives { internal DataBoxCopyStartedEventData() { } public string SerialNumber { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName StageName { get { throw null; } } - public System.DateTimeOffset StageTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2015,8 +2015,8 @@ public partial class DataBoxOrderCompletedEventData : System.ClientModel.Primiti { internal DataBoxOrderCompletedEventData() { } public string SerialNumber { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName StageName { get { throw null; } } - public System.DateTimeOffset StageTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2152,150 +2152,150 @@ internal DeviceTwinProperties() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientCreatedOrUpdatedEventData() { } + internal EventGridMqttClientCreatedOrUpdatedEventData() { } public System.Collections.Generic.IReadOnlyDictionary Attributes { get { throw null; } } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState State { get { throw null; } } - public System.DateTimeOffset UpdatedOn { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class EventGridMQTTClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal EventGridMQTTClientDeletedEventData() { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? State { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EventGridMqttClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EventGridMqttClientDeletedEventData() { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventGridMQTTClientDisconnectionReason : System.IEquatable + public readonly partial struct EventGridMqttClientDisconnectionReason : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventGridMQTTClientDisconnectionReason(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientAuthenticationError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientAuthorizationError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ConnectionLost { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason IpForbidden { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason QuotaExceeded { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ServerError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason SessionOverflow { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason SessionTakenOver { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason other) { throw null; } + public EventGridMqttClientDisconnectionReason(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthenticationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthorizationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ConnectionLost { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason IpForbidden { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason QuotaExceeded { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionOverflow { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionTakenOver { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason right) { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } public override string ToString() { throw null; } } - public partial class EventGridMQTTClientEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientEventData() { } + internal EventGridMqttClientEventData() { } public string ClientAuthenticationName { get { throw null; } } public string ClientName { get { throw null; } } public string NamespaceName { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientSessionConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientSessionConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientSessionConnectedEventData() { } + internal EventGridMqttClientSessionConnectedEventData() { } public string ClientSessionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientSessionDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientSessionDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientSessionDisconnectedEventData() { } + internal EventGridMqttClientSessionDisconnectedEventData() { } public string ClientSessionName { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason DisconnectionReason { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? DisconnectionReason { get { throw null; } } public long? SequenceNumber { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventGridMQTTClientState : System.IEquatable + public readonly partial struct EventGridMqttClientState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventGridMQTTClientState(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState Disabled { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState Enabled { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState other) { throw null; } + public EventGridMqttClientState(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Disabled { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Enabled { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState right) { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } public override string ToString() { throw null; } } public static partial class EventGridSystemEventsModelFactory { public static Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties AcsChatEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties AcsChatEventInThreadBaseProperties(string transactionId = null, string threadId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset editTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset editTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties AcsChatThreadParticipantProperties(string displayName = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel participantCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset editTime = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset editTime = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus), Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, System.DateTimeOffset deliveryAttemptTimestamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus?), Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, System.DateTimeOffset? deliveryAttemptTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDetails(string statusMessage = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, System.DateTimeOffset userActionTimestamp = default(System.DateTimeOffset), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, System.DateTimeOffset? userActionTimestamp = default(System.DateTimeOffset?), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext AcsIncomingCallCustomContext(System.Collections.Generic.IReadOnlyDictionary sipHeaders = null, System.Collections.Generic.IReadOnlyDictionary voipHeaders = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData AcsIncomingCallEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel toCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel fromCommunicationIdentifier = null, string serverCallId = null, string callerDisplayName = null, Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext customContext = null, string incomingCallContext = null, string correlationId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent AcsMessageButtonContent(string text = null, string payload = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError AcsMessageChannelEventError(string channelCode = null, string channelMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext AcsMessageContext(string from = null, string messageId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData AcsMessageEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData AcsMessageEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent AcsMessageInteractiveButtonReplyContent(string buttonId = null, string title = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent AcsMessageInteractiveContent(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind replyKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent buttonReply = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent listReply = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent AcsMessageInteractiveContent(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? replyKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent buttonReply = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent listReply = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent AcsMessageInteractiveListReplyContent(string listItemId = null, string title = null, string description = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent AcsMessageMediaContent(string mimeType = null, string mediaId = null, string fileName = null, string caption = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData AcsMessageReceivedEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string content = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent mediaContent = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext context = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent button = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent interactiveContent = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData AcsMessageReceivedEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string content = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent mediaContent = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext context = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent button = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent interactiveContent = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(string documentId = null, long? index = default(long?), string endReason = null, string metadataLocation = null, string contentLocation = null, string deleteLocation = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties recordingStorageInfo = null, System.DateTimeOffset recordingStartTime = default(System.DateTimeOffset), long? recordingDurationMs = default(long?), Azure.Messaging.EventGrid.SystemEvents.RecordingContentType recordingContentType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingContentType), Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType recordingChannelKind = default(Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType), Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType recordingFormatType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType), string sessionEndReason = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties recordingStorageInfo = null, System.DateTimeOffset? recordingStartTime = default(System.DateTimeOffset?), long? recordingDurationMs = default(long?), Azure.Messaging.EventGrid.SystemEvents.RecordingContentType? recordingContentType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingContentType?), Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType? recordingChannelKind = default(Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType?), Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType? recordingFormatType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType?), string sessionEndReason = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties AcsRecordingStorageInfoProperties(System.Collections.Generic.IEnumerable recordingChunks = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string channelId = null, int? capacityCostPerJob = default(int?), int? maxNumberOfJobs = default(int?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterCommunicationError AcsRouterCommunicationError(string code = null, string message = null, string target = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterCommunicationError innererror = null, System.Collections.Generic.IEnumerable details = null) { throw null; } @@ -2309,10 +2309,10 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData AcsRouterJobEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTriggeredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string ruleKey = null, string exceptionRuleId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable attachedWorkerSelectors = null, System.Collections.Generic.IEnumerable requestedWorkerSelectors = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus jobStatus = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus), string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable requestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), bool unavailableForMatching = false) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), string failureReason = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? jobStatus = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus?), string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable requestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), string failureReason = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWorkerSelectorsExpiredEventData AcsRouterJobWorkerSelectorsExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, string name = null, System.Collections.Generic.IReadOnlyDictionary labels = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeletedEventData AcsRouterWorkerDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) { throw null; } @@ -2321,15 +2321,15 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAcceptedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, string assignmentId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferDeclinedEventData AcsRouterWorkerOfferDeclinedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.DateTimeOffset offeredOn = default(System.DateTimeOffset), System.DateTimeOffset expiresOn = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.DateTimeOffset? offeredOn = default(System.DateTimeOffset?), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = null, System.Collections.Generic.IEnumerable queueAssignments = null, System.Collections.Generic.IEnumerable channelConfigurations = null, int? totalCapacity = default(int?), System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator labelOperator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator), System.BinaryData labelValue = null, double timeToLive = 0, Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState selectorState = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState), System.DateTimeOffset expirationTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? labelOperator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator?), System.BinaryData labelValue = null, double timeToLive = 0, Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? selectorState = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState?), System.DateTimeOffset? expirationTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(string workerId = null, System.Collections.Generic.IEnumerable queueAssignments = null, System.Collections.Generic.IEnumerable channelConfigurations = null, int? totalCapacity = default(int?), System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, System.Collections.Generic.IEnumerable updatedWorkerProperties = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(System.DateTimeOffset timestamp = default(System.DateTimeOffset), int? segmentsSucceeded = default(int?), int? segmentsFailed = default(int?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, System.Collections.Generic.IEnumerable deliveryAttempts = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), string tag = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), int? segmentsSucceeded = default(int?), int? segmentsFailed = default(int?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, System.Collections.Generic.IEnumerable deliveryAttempts = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), string tag = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties AcsSmsEventBaseProperties(string messageId = null, string from = null, string to = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string from = null, string to = null, string message = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string from = null, string to = null, string message = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData AcsUserDisconnectedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel userCommunicationIdentifier = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData ApiCenterApiDefinitionAddedEventData(string title = null, string description = null, Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification specification = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData ApiCenterApiDefinitionUpdatedEventData(string title = null, string description = null, Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification specification = null) { throw null; } @@ -2365,8 +2365,8 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind? stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind?), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction?), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterCreatedEventData AvsClusterCreatedEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterDeletedEventData AvsClusterDeletedEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData AvsClusterEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } @@ -2382,20 +2382,20 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData AvsScriptExecutionFailedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null, string failureMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData AvsScriptExecutionFinishedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null, System.Collections.Generic.IReadOnlyDictionary namedOutputs = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData AvsScriptExecutionStartedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind kind = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind), string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind? kind = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind?), string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel CommunicationUserIdentifierModel(string id = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEventTarget(string mediaType = null, long? size = default(long?), string digest = null, string repository = null, string tag = null, string name = null, string version = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor ContainerRegistryEventActor(string name = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry ContainerRegistryEventConnectedRegistry(string name = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData ContainerRegistryEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData ContainerRegistryEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest ContainerRegistryEventRequest(string id = null, string addr = null, string host = null, string method = null, string useragent = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource ContainerRegistryEventSource(string addr = null, string instanceID = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget ContainerRegistryEventTarget(string mediaType = null, long? size = default(long?), string digest = null, long? length = default(long?), string repository = null, string url = null, string tag = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndedEventData ContainerServiceClusterSupportEndedEventData(string kubernetesVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndingEventData ContainerServiceClusterSupportEndingEventData(string kubernetesVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData ContainerServiceClusterSupportEventData(string kubernetesVersion = null) { throw null; } @@ -2404,9 +2404,9 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingFailedEventData ContainerServiceNodePoolRollingFailedEventData(string nodePoolName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingStartedEventData ContainerServiceNodePoolRollingStartedEventData(string nodePoolName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingSucceededEventData ContainerServiceNodePoolRollingSucceededEventData(string nodePoolName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo DeviceConnectionStateEventInfo(string sequenceNumber = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties DeviceConnectionStateEventProperties(string deviceId = null, string moduleId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties DeviceLifeCycleEventProperties(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } @@ -2416,18 +2416,18 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint DeviceTwinInfoX509Thumbprint(string primaryThumbprint = null, string secondaryThumbprint = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata DeviceTwinMetadata(string lastUpdated = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties DeviceTwinProperties(Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata metadata = null, float? version = default(float?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState state = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset updatedOn = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary attributes = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDeletedEventData EventGridMQTTClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData EventGridMQTTClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionDisconnectedEventData EventGridMQTTClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?), Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason disconnectionReason = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = default(int?), int? eventCount = default(int?), int? firstSequenceNumber = default(int?), int? lastSequenceNumber = default(int?), System.DateTimeOffset firstEnqueueTime = default(System.DateTimeOffset), System.DateTimeOffset lastEnqueueTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? state = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary attributes = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?), Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? disconnectionReason = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = default(int?), int? eventCount = default(int?), int? firstSequenceNumber = default(int?), int? lastSequenceNumber = default(int?), System.DateTimeOffset? firstEnqueueTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastEnqueueTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData HealthcareDicomImageCreatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData HealthcareDicomImageUpdatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceConnectedEventData IotHubDeviceConnectedEventData(string deviceId = null, string moduleId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceCreatedEventData IotHubDeviceCreatedEventData(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDeletedEventData IotHubDeviceDeletedEventData(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } @@ -2443,7 +2443,7 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData KeyVaultSecretExpiredEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData KeyVaultSecretNearExpiryEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData KeyVaultSecretNewVersionCreatedEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = default(double?), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = default(double?), System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData MachineLearningServicesModelDeployedEventData(string serviceName = null, string serviceComputeType = null, string modelIds = null, System.Collections.Generic.IReadOnlyDictionary serviceTags = null, System.Collections.Generic.IReadOnlyDictionary serviceProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData MachineLearningServicesModelRegisteredEventData(string modelName = null, string modelVersion = null, System.Collections.Generic.IReadOnlyDictionary modelTags = null, System.Collections.Generic.IReadOnlyDictionary modelProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData MachineLearningServicesRunCompletedEventData(string experimentId = null, string experimentName = null, string runId = null, string runType = null, System.Collections.Generic.IReadOnlyDictionary runTags = null, System.Collections.Generic.IReadOnlyDictionary runProperties = null) { throw null; } @@ -2453,25 +2453,25 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceExitedEventData MapsGeofenceExitedEventData(System.Collections.Generic.IEnumerable expiredGeofenceGeometryId = null, System.Collections.Generic.IEnumerable geometries = null, System.Collections.Generic.IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = default(bool?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry MapsGeofenceGeometry(string deviceId = null, float? distance = default(float?), string geometryId = null, float? nearestLat = default(float?), float? nearestLon = default(float?), string udId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceResultEventData MapsGeofenceResultEventData(System.Collections.Generic.IEnumerable expiredGeofenceGeometryId = null, System.Collections.Generic.IEnumerable geometries = null, System.Collections.Generic.IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = default(bool?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData MediaJobCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData MediaJobCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobError MediaJobError(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode code = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode), string message = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory category = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory), Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry retry = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry), System.Collections.Generic.IEnumerable details = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData MediaJobCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData MediaJobCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobError MediaJobError(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode? code = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode?), string message = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory? category = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory?), Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry? retry = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry?), System.Collections.Generic.IEnumerable details = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorDetail MediaJobErrorDetail(string code = null, string message = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData MediaJobErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData MediaJobFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput MediaJobOutput(string odataType = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset MediaJobOutputAsset(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), string assetName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData MediaJobOutputErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData MediaJobErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData MediaJobFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput MediaJobOutput(string odataType = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset MediaJobOutputAsset(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), string assetName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData MediaJobOutputErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProgressEventData MediaJobOutputProgressEventData(string label = null, long? progress = default(long?), System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData MediaJobProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData MediaJobScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData MediaJobStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData MediaJobProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData MediaJobScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData MediaJobStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventChannelArchiveHeartbeatEventData MediaLiveEventChannelArchiveHeartbeatEventData(string channelLatencyMs = null, string latencyResultCode = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventConnectionRejectedEventData MediaLiveEventConnectionRejectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null, string resultCode = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderConnectedEventData MediaLiveEventEncoderConnectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null) { throw null; } @@ -2482,16 +2482,16 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(string firstTimestamp = null, string firstDuration = null, string secondTimestamp = null, string secondDuration = null, string timescale = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIngestHeartbeatEventData MediaLiveEventIngestHeartbeatEventData(string trackType = null, string trackName = null, string transcriptionLanguage = null, string transcriptionState = null, long? bitrate = default(long?), long? incomingBitrate = default(long?), string ingestDriftValue = null, string lastFragmentArrivalTime = null, string lastTimestamp = null, string timescale = null, long? overlapCount = default(long?), long? discontinuityCount = default(long?), long? nonincreasingCount = default(long?), bool? unexpectedBitrate = default(bool?), string state = null, bool? healthy = default(bool?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventTrackDiscontinuityDetectedEventData MediaLiveEventTrackDiscontinuityDetectedEventData(string trackType = null, string trackName = null, long? bitrate = default(long?), string previousTimestamp = null, string newTimestamp = null, string timescale = null, string discontinuityGap = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = default(bool?), Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = default(bool?), Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumberIdentifierModel(string value = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisExportRDBCompletedEventData RedisExportRDBCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisImportRDBCompletedEventData RedisImportRDBCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData RedisPatchingCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData RedisScalingCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData RedisExportRdbCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData RedisPatchingCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData RedisScalingCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData ResourceActionCancelEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData ResourceActionFailureEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData ResourceActionSuccessEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } @@ -2502,7 +2502,7 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, string method = null, string url = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(System.DateTimeOffset resourceEventTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(System.DateTimeOffset? resourceEventTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails ResourceNotificationsResourceDeletedDetails(string id = null, string name = null, string type = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData ResourceNotificationsResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementCreatedOrUpdatedEventData ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } @@ -2516,23 +2516,23 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string hubName = null, string connectionId = null, string userId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData StorageAsyncOperationInitiatedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData StorageBlobDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset scheduleDateTime = default(System.DateTimeOffset), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset? scheduleDateTime = default(System.DateTimeOffset?), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData StorageBlobRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier previousTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, string recursive = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount = default(long?), long? successCount = default(long?), string errorList = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus), System.DateTimeOffset completedOn = default(System.DateTimeOffset), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(System.DateTimeOffset queuedOn = default(System.DateTimeOffset), string taskExecutionId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData StorageTaskCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus), System.DateTimeOffset completedDateTime = default(System.DateTimeOffset), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUrl = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData StorageTaskQueuedEventData(System.DateTimeOffset queuedDateTime = default(System.DateTimeOffset), string taskExecutionId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(System.DateTimeOffset? queuedOn = default(System.DateTimeOffset?), string taskExecutionId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData StorageTaskCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus?), System.DateTimeOffset? completedDateTime = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUrl = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData StorageTaskQueuedEventData(System.DateTimeOffset? queuedDateTime = default(System.DateTimeOffset?), string taskExecutionId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData SubscriptionDeletedEventData(string eventSubscriptionId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData SubscriptionValidationEventData(string validationCode = null, string validationUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse SubscriptionValidationResponse(string validationResponse = null) { throw null; } @@ -2557,9 +2557,9 @@ internal EventHubCaptureFileCreatedEventData() { } public int? EventCount { get { throw null; } } public string FileType { get { throw null; } } public string Fileurl { get { throw null; } } - public System.DateTimeOffset FirstEnqueueTime { get { throw null; } } + public System.DateTimeOffset? FirstEnqueueTime { get { throw null; } } public int? FirstSequenceNumber { get { throw null; } } - public System.DateTimeOffset LastEnqueueTime { get { throw null; } } + public System.DateTimeOffset? LastEnqueueTime { get { throw null; } } public int? LastSequenceNumber { get { throw null; } } public string PartitionId { get { throw null; } } public int? SizeInBytes { get { throw null; } } @@ -2618,7 +2618,7 @@ public partial class HealthcareFhirResourceCreatedEventData : System.ClientModel { internal HealthcareFhirResourceCreatedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2631,7 +2631,7 @@ public partial class HealthcareFhirResourceDeletedEventData : System.ClientModel { internal HealthcareFhirResourceDeletedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2821,7 +2821,7 @@ public partial class HealthcareFhirResourceUpdatedEventData : System.ClientModel { internal HealthcareFhirResourceUpdatedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3042,9 +3042,9 @@ internal MachineLearningServicesDatasetDriftDetectedEventData() { } public string DataDriftId { get { throw null; } } public string DataDriftName { get { throw null; } } public double? DriftCoefficient { get { throw null; } } - public System.DateTimeOffset EndTime { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } } public string RunId { get { throw null; } } - public System.DateTimeOffset StartTime { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } public string TargetDatasetId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3187,11 +3187,11 @@ internal MediaJobCancelingEventData() { } public partial class MediaJobError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MediaJobError() { } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Category { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode Code { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory? Category { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode? Code { get { throw null; } } public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } public string Message { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry Retry { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry? Retry { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MediaJobError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3279,11 +3279,11 @@ internal MediaJobFinishedEventData() { } } public abstract partial class MediaJobOutput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - protected MediaJobOutput(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error, long progress, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state) { } + protected MediaJobOutput(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error, long progress) { } public Azure.Messaging.EventGrid.SystemEvents.MediaJobError Error { get { throw null; } } public string Label { get { throw null; } } public long Progress { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState State { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobState? State { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3292,7 +3292,7 @@ protected MediaJobOutput(Azure.Messaging.EventGrid.SystemEvents.MediaJobError er } public partial class MediaJobOutputAsset : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MediaJobOutputAsset() : base (default(Azure.Messaging.EventGrid.SystemEvents.MediaJobError), default(long), default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState)) { } + internal MediaJobOutputAsset() : base (default(Azure.Messaging.EventGrid.SystemEvents.MediaJobError), default(long)) { } public string AssetName { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3371,7 +3371,7 @@ public partial class MediaJobOutputStateChangeEventData : System.ClientModel.Pri internal MediaJobOutputStateChangeEventData() { } public System.Collections.Generic.IReadOnlyDictionary JobCorrelationData { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput Output { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState PreviousState { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobState? PreviousState { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3441,8 +3441,8 @@ public partial class MediaJobStateChangeEventData : System.ClientModel.Primitive { internal MediaJobStateChangeEventData() { } public System.Collections.Generic.IReadOnlyDictionary CorrelationData { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState PreviousState { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState State { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobState? PreviousState { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobState? State { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3608,7 +3608,7 @@ public partial class MicrosoftTeamsAppIdentifierModel : System.ClientModel.Primi { internal MicrosoftTeamsAppIdentifierModel() { } public string AppId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Cloud { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3618,7 +3618,7 @@ internal MicrosoftTeamsAppIdentifierModel() { } public partial class MicrosoftTeamsUserIdentifierModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MicrosoftTeamsUserIdentifierModel() { } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Cloud { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } public bool? IsAnonymous { get { throw null; } } public string UserId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3646,7 +3646,7 @@ internal PolicyInsightsPolicyStateChangedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3662,7 +3662,7 @@ internal PolicyInsightsPolicyStateCreatedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3678,7 +3678,7 @@ internal PolicyInsightsPolicyStateDeletedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3740,36 +3740,36 @@ internal PolicyInsightsPolicyStateDeletedEventData() { } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType left, Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType right) { throw null; } public override string ToString() { throw null; } } - public partial class RedisExportRDBCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class RedisExportRdbCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal RedisExportRDBCompletedEventData() { } + internal RedisExportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.RedisExportRDBCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.RedisExportRDBCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public System.DateTimeOffset? Timestamp { get { throw null; } } + Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class RedisImportRDBCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class RedisImportRdbCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal RedisImportRDBCompletedEventData() { } + internal RedisImportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.RedisImportRDBCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.RedisImportRDBCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public System.DateTimeOffset? Timestamp { get { throw null; } } + Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class RedisPatchingCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal RedisPatchingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3781,7 +3781,7 @@ public partial class RedisScalingCompletedEventData : System.ClientModel.Primiti internal RedisScalingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3954,7 +3954,7 @@ internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData( public partial class ResourceNotificationsOperationalDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsOperationalDetails() { } - public System.DateTimeOffset ResourceEventTime { get { throw null; } } + public System.DateTimeOffset? ResourceEventTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4154,7 +4154,7 @@ public partial class SignalRServiceClientConnectionConnectedEventData : System.C internal SignalRServiceClientConnectionConnectedEventData() { } public string ConnectionId { get { throw null; } } public string HubName { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -4168,7 +4168,7 @@ internal SignalRServiceClientConnectionDisconnectedEventData() { } public string ConnectionId { get { throw null; } } public string ErrorMessage { get { throw null; } } public string HubName { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -4214,9 +4214,31 @@ internal StorageAsyncOperationInitiatedEventData() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageBlobAccessTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageBlobAccessTier(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Archive { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cold { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cool { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Default { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Hot { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageBlobCreatedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageBlobCreatedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } @@ -4262,7 +4284,7 @@ internal StorageBlobInventoryPolicyCompletedEventData() { } public string PolicyRunStatus { get { throw null; } } public string PolicyRunStatusMessage { get { throw null; } } public string RuleName { get { throw null; } } - public System.DateTimeOffset ScheduleDateTime { get { throw null; } } + public System.DateTimeOffset? ScheduleDateTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4289,12 +4311,14 @@ internal StorageBlobRenamedEventData() { } public partial class StorageBlobTierChangedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageBlobTierChangedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } public long? ContentLength { get { throw null; } } public string ContentType { get { throw null; } } public string Identity { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier PreviousTier { get { throw null; } } public string RequestId { get { throw null; } } public string Sequencer { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary StorageDiagnostics { get { throw null; } } @@ -4384,8 +4408,8 @@ internal StorageLifecyclePolicyCompletedEventData() { } public partial class StorageTaskAssignmentCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskAssignmentCompletedEventData() { } - public System.DateTimeOffset CompletedOn { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus Status { get { throw null; } } + public System.DateTimeOffset? CompletedOn { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? Status { get { throw null; } } public System.Uri SummaryReportBlobUri { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } @@ -4416,7 +4440,7 @@ internal StorageTaskAssignmentCompletedEventData() { } public partial class StorageTaskAssignmentQueuedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskAssignmentQueuedEventData() { } - public System.DateTimeOffset QueuedOn { get { throw null; } } + public System.DateTimeOffset? QueuedOn { get { throw null; } } public string TaskExecutionId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -4427,8 +4451,8 @@ internal StorageTaskAssignmentQueuedEventData() { } public partial class StorageTaskCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskCompletedEventData() { } - public System.DateTimeOffset CompletedDateTime { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus Status { get { throw null; } } + public System.DateTimeOffset? CompletedDateTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? Status { get { throw null; } } public System.Uri SummaryReportBlobUrl { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } @@ -4459,7 +4483,7 @@ internal StorageTaskCompletedEventData() { } public partial class StorageTaskQueuedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskQueuedEventData() { } - public System.DateTimeOffset QueuedDateTime { get { throw null; } } + public System.DateTimeOffset? QueuedDateTime { get { throw null; } } public string TaskExecutionId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -4604,10 +4628,10 @@ public static partial class SystemEventNames public const string DataBoxCopyCompleted = "Microsoft.DataBox.CopyCompleted"; public const string DataBoxCopyStarted = "Microsoft.DataBox.CopyStarted"; public const string DataBoxOrderCompleted = "Microsoft.DataBox.OrderCompleted"; - public const string EventGridMQTTClientCreatedOrUpdated = "Microsoft.EventGrid.MQTTClientCreatedOrUpdated"; - public const string EventGridMQTTClientDeleted = "Microsoft.EventGrid.MQTTClientDeleted"; - public const string EventGridMQTTClientSessionConnected = "Microsoft.EventGrid.MQTTClientSessionConnected"; - public const string EventGridMQTTClientSessionDisconnected = "Microsoft.EventGrid.MQTTClientSessionDisconnected"; + public const string EventGridMqttClientCreatedOrUpdated = "Microsoft.EventGrid.MQTTClientCreatedOrUpdated"; + public const string EventGridMqttClientDeleted = "Microsoft.EventGrid.MQTTClientDeleted"; + public const string EventGridMqttClientSessionConnected = "Microsoft.EventGrid.MQTTClientSessionConnected"; + public const string EventGridMqttClientSessionDisconnected = "Microsoft.EventGrid.MQTTClientSessionDisconnected"; public const string EventGridSubscriptionDeleted = "Microsoft.EventGrid.SubscriptionDeletedEvent"; public const string EventGridSubscriptionValidation = "Microsoft.EventGrid.SubscriptionValidationEvent"; public const string EventHubCaptureFileCreated = "Microsoft.EventHub.CaptureFileCreated"; @@ -4668,8 +4692,8 @@ public static partial class SystemEventNames public const string PolicyInsightsPolicyStateChanged = "Microsoft.PolicyInsights.PolicyStateChanged"; public const string PolicyInsightsPolicyStateCreated = "Microsoft.PolicyInsights.PolicyStateCreated"; public const string PolicyInsightsPolicyStateDeleted = "Microsoft.PolicyInsights.PolicyStateDeleted"; - public const string RedisExportRDBCompleted = "Microsoft.Cache.ExportRDBCompleted"; - public const string RedisImportRDBCompleted = "Microsoft.Cache.ImportRDBCompleted"; + public const string RedisExportRdbCompleted = "Microsoft.Cache.ExportRDBCompleted"; + public const string RedisImportRdbCompleted = "Microsoft.Cache.ImportRDBCompleted"; public const string RedisPatchingCompleted = "Microsoft.Cache.PatchingCompleted"; public const string RedisScalingCompleted = "Microsoft.Cache.ScalingCompleted"; public const string ResourceActionCancel = "Microsoft.Resources.ResourceActionCancel"; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs index e119d27c44d3..40761e19f713 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -40,8 +43,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -102,11 +108,11 @@ internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedE { return null; } - DateTimeOffset deleteTime = default; + DateTimeOffset? deleteTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -118,6 +124,10 @@ internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedE { if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -138,6 +148,10 @@ internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedE } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs index 29bd2123a788..5f6a22502794 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs @@ -16,15 +16,11 @@ public partial class AcsChatMessageDeletedEventData : AcsChatMessageEventBasePro /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. - /// The time at which the message was deleted. /// or is null. - internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime) + internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -39,7 +35,7 @@ internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCo /// The type of the message. /// The version of the message. /// The time at which the message was deleted. - internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { DeleteTime = deleteTime; } @@ -50,6 +46,6 @@ internal AcsChatMessageDeletedEventData() } /// The time at which the message was deleted. - public DateTimeOffset DeleteTime { get; } + public DateTimeOffset? DeleteTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs index 7d5664edf25f..01c09eb8b6c9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -40,8 +43,11 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -100,11 +106,11 @@ internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessage { return null; } - DateTimeOffset deleteTime = default; + DateTimeOffset? deleteTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -115,6 +121,10 @@ internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessage { if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -135,6 +145,10 @@ internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessage } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs index fdf50c683027..36a7b77ba1a3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs @@ -15,14 +15,10 @@ public partial class AcsChatMessageDeletedInThreadEventData : AcsChatMessageEven { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. - /// The time at which the message was deleted. /// is null. - internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, DateTimeOffset deleteTime) : base(senderCommunicationIdentifier, composeTime) + internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier) : base(senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -36,7 +32,7 @@ internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel sen /// The type of the message. /// The version of the message. /// The time at which the message was deleted. - internal AcsChatMessageDeletedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, DateTimeOffset deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageDeletedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { DeleteTime = deleteTime; } @@ -47,6 +43,6 @@ internal AcsChatMessageDeletedInThreadEventData() } /// The time at which the message was deleted. - public DateTimeOffset DeleteTime { get; } + public DateTimeOffset? DeleteTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs index 73612534305b..ba4f0b0d34e3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs @@ -39,8 +39,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -53,8 +56,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -117,11 +123,11 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve } string messageBody = default; IReadOnlyDictionary metadata = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -148,6 +154,10 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -168,6 +178,10 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs index 92f3f537ac6c..b124a0af4025 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs @@ -16,18 +16,15 @@ public partial class AcsChatMessageEditedEventData : AcsChatMessageEventBaseProp /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. - /// The time at which the message was edited. /// , or is null. - internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime) + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); Argument.AssertNotNull(metadata, nameof(metadata)); Metadata = metadata; - EditTime = editTime; } /// Initializes a new instance of . @@ -44,7 +41,7 @@ internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCom /// The body of the chat message. /// The chat message metadata. /// The time at which the message was edited. - internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset? editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; Metadata = metadata; @@ -61,6 +58,6 @@ internal AcsChatMessageEditedEventData() /// The chat message metadata. public IReadOnlyDictionary Metadata { get; } /// The time at which the message was edited. - public DateTimeOffset EditTime { get; } + public DateTimeOffset? EditTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs index 5caa33f2df29..52c02562502e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs @@ -39,8 +39,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -53,8 +56,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -115,11 +121,11 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE } string messageBody = default; IReadOnlyDictionary metadata = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -145,6 +151,10 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -165,6 +175,10 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs index 99134233639c..70250f33da52 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs @@ -15,17 +15,14 @@ public partial class AcsChatMessageEditedInThreadEventData : AcsChatMessageEvent { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. - /// The time at which the message was edited. /// or is null. - internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(senderCommunicationIdentifier, composeTime) + internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); Argument.AssertNotNull(metadata, nameof(metadata)); Metadata = metadata; - EditTime = editTime; } /// Initializes a new instance of . @@ -41,7 +38,7 @@ internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel send /// The body of the chat message. /// The chat message metadata. /// The time at which the message was edited. - internal AcsChatMessageEditedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageEditedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset? editTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; Metadata = metadata; @@ -58,6 +55,6 @@ internal AcsChatMessageEditedInThreadEventData() /// The chat message metadata. public IReadOnlyDictionary Metadata { get; } /// The time at which the message was edited. - public DateTimeOffset EditTime { get; } + public DateTimeOffset? EditTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs index e91d6c8d1ec1..fd64fd00f375 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs @@ -38,8 +38,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -103,7 +106,7 @@ internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEvent string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -130,6 +133,10 @@ internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEvent } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs index d0109a86be03..0d2231a308ce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs @@ -16,15 +16,13 @@ public partial class AcsChatMessageEventBaseProperties : AcsChatEventBasePropert /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. /// or is null. - internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime) : base(recipientCommunicationIdentifier) + internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); SenderCommunicationIdentifier = senderCommunicationIdentifier; - ComposeTime = composeTime; } /// Initializes a new instance of . @@ -38,7 +36,7 @@ internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipien /// The original compose time of the message. /// The type of the message. /// The version of the message. - internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) + internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) { MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; @@ -60,7 +58,7 @@ internal AcsChatMessageEventBaseProperties() /// The display name of the sender. public string SenderDisplayName { get; } /// The original compose time of the message. - public DateTimeOffset ComposeTime { get; } + public DateTimeOffset? ComposeTime { get; } /// The type of the message. public string Type { get; } /// The version of the message. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs index 86cfe4a2d5a6..ceb1b1a5f639 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs @@ -38,8 +38,11 @@ void IJsonModel.Write(Utf8JsonWriter writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -101,7 +104,7 @@ internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMess string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -127,6 +130,10 @@ internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMess } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs index 72fdab5e25f7..3ae4acc44ddd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs @@ -15,14 +15,12 @@ public partial class AcsChatMessageEventInThreadBaseProperties : AcsChatEventInT { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. /// is null. - internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime) + internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); SenderCommunicationIdentifier = senderCommunicationIdentifier; - ComposeTime = composeTime; } /// Initializes a new instance of . @@ -35,7 +33,7 @@ internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel /// The original compose time of the message. /// The type of the message. /// The version of the message. - internal AcsChatMessageEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatMessageEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; @@ -57,7 +55,7 @@ internal AcsChatMessageEventInThreadBaseProperties() /// The display name of the sender. public string SenderDisplayName { get; } /// The original compose time of the message. - public DateTimeOffset ComposeTime { get; } + public DateTimeOffset? ComposeTime { get; } /// The type of the message. public string Type { get; } /// The version of the message. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs index de232d602072..33da4e20bebe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs @@ -51,8 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -118,7 +121,7 @@ internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceive string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -160,6 +163,10 @@ internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceive } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs index 2410db3e730b..1f9a4f91d206 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs @@ -16,10 +16,9 @@ public partial class AcsChatMessageReceivedEventData : AcsChatMessageEventBasePr /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. /// , or is null. - internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime) + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); @@ -41,7 +40,7 @@ internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientC /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; Metadata = metadata; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs index 3f562ca687e2..0a01774108b9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs @@ -51,8 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -116,7 +119,7 @@ internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessag string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -157,6 +160,10 @@ internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessag } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs index 8698284721c1..c99363e44298 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs @@ -15,10 +15,9 @@ public partial class AcsChatMessageReceivedInThreadEventData : AcsChatMessageEve { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. /// or is null. - internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier, composeTime) + internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); Argument.AssertNotNull(metadata, nameof(metadata)); @@ -38,7 +37,7 @@ internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel se /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatMessageReceivedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageReceivedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; Metadata = metadata; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs index 8149e4a55184..76e4b55b686e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteStartObject(); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("addedByCommunicationIdentifier"u8); writer.WriteObjectValue(AddedByCommunicationIdentifier, options); writer.WritePropertyName("participantAdded"u8); @@ -85,7 +88,7 @@ internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParti { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel addedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantAdded = default; long? version = default; @@ -97,6 +100,10 @@ internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParti { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs index 0c74e23af594..5ae69978e278 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs @@ -14,16 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatParticipantAddedToThreadEventData : AcsChatEventInThreadBaseProperties { /// Initializes a new instance of . - /// The time at which the user was added to the thread. /// The communication identifier of the user who added the user. /// The details of the user who was added. /// or is null. - internal AcsChatParticipantAddedToThreadEventData(DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) + internal AcsChatParticipantAddedToThreadEventData(CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) { Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier)); Argument.AssertNotNull(participantAdded, nameof(participantAdded)); - Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; ParticipantAdded = participantAdded; } @@ -36,7 +34,7 @@ internal AcsChatParticipantAddedToThreadEventData(DateTimeOffset time, Communica /// The communication identifier of the user who added the user. /// The details of the user who was added. /// The version of the thread. - internal AcsChatParticipantAddedToThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatParticipantAddedToThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; @@ -50,7 +48,7 @@ internal AcsChatParticipantAddedToThreadEventData() } /// The time at which the user was added to the thread. - public DateTimeOffset Time { get; } + public DateTimeOffset? Time { get; } /// The communication identifier of the user who added the user. public CommunicationIdentifierModel AddedByCommunicationIdentifier { get; } /// The details of the user who was added. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs index b105a0d9f4b5..ea812f2030ed 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs @@ -26,14 +26,20 @@ void IJsonModel.Write(Utf8Json } writer.WriteStartObject(); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("addedByCommunicationIdentifier"u8); writer.WriteObjectValue(AddedByCommunicationIdentifier, options); writer.WritePropertyName("participantAdded"u8); writer.WriteObjectValue(ParticipantAdded, options); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -89,10 +95,10 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel addedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantAdded = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -103,6 +109,10 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } @@ -118,6 +128,10 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs index 95e15aab1526..407412eb394b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs @@ -15,18 +15,15 @@ public partial class AcsChatParticipantAddedToThreadWithUserEventData : AcsChatT { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. - /// The time at which the user was added to the thread. /// The communication identifier of the user who added the user. /// The details of the user who was added. /// , or is null. - internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier)); Argument.AssertNotNull(participantAdded, nameof(participantAdded)); - Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; ParticipantAdded = participantAdded; } @@ -41,7 +38,7 @@ internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifie /// The time at which the user was added to the thread. /// The communication identifier of the user who added the user. /// The details of the user who was added. - internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; @@ -54,7 +51,7 @@ internal AcsChatParticipantAddedToThreadWithUserEventData() } /// The time at which the user was added to the thread. - public DateTimeOffset Time { get; } + public DateTimeOffset? Time { get; } /// The communication identifier of the user who added the user. public CommunicationIdentifierModel AddedByCommunicationIdentifier { get; } /// The details of the user who was added. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs index 9edc7fa55d10..4bf5b1a6ef97 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWrit } writer.WriteStartObject(); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("removedByCommunicationIdentifier"u8); writer.WriteObjectValue(RemovedByCommunicationIdentifier, options); writer.WritePropertyName("participantRemoved"u8); @@ -85,7 +88,7 @@ internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatP { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel removedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantRemoved = default; long? version = default; @@ -97,6 +100,10 @@ internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatP { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs index 2984453d0a26..b3b2328112b9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs @@ -14,16 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatParticipantRemovedFromThreadEventData : AcsChatEventInThreadBaseProperties { /// Initializes a new instance of . - /// The time at which the user was removed to the thread. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// or is null. - internal AcsChatParticipantRemovedFromThreadEventData(DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) + internal AcsChatParticipantRemovedFromThreadEventData(CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) { Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier)); Argument.AssertNotNull(participantRemoved, nameof(participantRemoved)); - Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; ParticipantRemoved = participantRemoved; } @@ -36,7 +34,7 @@ internal AcsChatParticipantRemovedFromThreadEventData(DateTimeOffset time, Commu /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// The version of the thread. - internal AcsChatParticipantRemovedFromThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatParticipantRemovedFromThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; @@ -50,7 +48,7 @@ internal AcsChatParticipantRemovedFromThreadEventData() } /// The time at which the user was removed to the thread. - public DateTimeOffset Time { get; } + public DateTimeOffset? Time { get; } /// The communication identifier of the user who removed the user. public CommunicationIdentifierModel RemovedByCommunicationIdentifier { get; } /// The details of the user who was removed. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs index df7207f1ca51..25c5b4c35d84 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs @@ -26,14 +26,20 @@ void IJsonModel.Write(Utf8 } writer.WriteStartObject(); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("removedByCommunicationIdentifier"u8); writer.WriteObjectValue(RemovedByCommunicationIdentifier, options); writer.WritePropertyName("participantRemoved"u8); writer.WriteObjectValue(ParticipantRemoved, options); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -89,10 +95,10 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel removedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantRemoved = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -103,6 +109,10 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } @@ -118,6 +128,10 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs index 109684ffc523..d99153a59c67 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs @@ -15,18 +15,15 @@ public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : AcsC { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. - /// The time at which the user was removed to the thread. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// , or is null. - internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier)); Argument.AssertNotNull(participantRemoved, nameof(participantRemoved)); - Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; ParticipantRemoved = participantRemoved; } @@ -41,7 +38,7 @@ internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdent /// The time at which the user was removed to the thread. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. - internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; @@ -54,7 +51,7 @@ internal AcsChatParticipantRemovedFromThreadWithUserEventData() } /// The time at which the user was removed to the thread. - public DateTimeOffset Time { get; } + public DateTimeOffset? Time { get; } /// The communication identifier of the user who removed the user. public CommunicationIdentifierModel RemovedByCommunicationIdentifier { get; } /// The details of the user who was removed. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs index 35cc001d00cf..79e744fed4d3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs @@ -63,8 +63,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -122,7 +125,7 @@ internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEve IReadOnlyDictionary properties = default; IReadOnlyDictionary metadata = default; IReadOnlyList participants = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -174,6 +177,10 @@ internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEve } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs index 30a77e8200e9..dd366f600f08 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs @@ -15,13 +15,12 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadCreatedEventData : AcsChatThreadEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. /// The communication identifier of the user who created the thread. /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. /// , , or is null. - internal AcsChatThreadCreatedEventData(DateTimeOffset createTime, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) : base(createTime) + internal AcsChatThreadCreatedEventData(CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) { Argument.AssertNotNull(createdByCommunicationIdentifier, nameof(createdByCommunicationIdentifier)); Argument.AssertNotNull(properties, nameof(properties)); @@ -44,7 +43,7 @@ internal AcsChatThreadCreatedEventData(DateTimeOffset createTime, CommunicationI /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. - internal AcsChatThreadCreatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadCreatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs index 6b404c6b6d3f..edafdf9a4d8a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs @@ -63,8 +63,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -124,7 +127,7 @@ internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCr IReadOnlyDictionary properties = default; IReadOnlyDictionary metadata = default; IReadOnlyList participants = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -177,6 +180,10 @@ internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCr } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs index 1016b59134b6..428a332bf9a3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs @@ -16,13 +16,12 @@ public partial class AcsChatThreadCreatedWithUserEventData : AcsChatThreadEventB { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// The communication identifier of the user who created the thread. /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. /// , , , or is null. - internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(createdByCommunicationIdentifier, nameof(createdByCommunicationIdentifier)); @@ -47,7 +46,7 @@ internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel reci /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. - internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs index abdb7611c8e8..853a18cacfe9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs @@ -28,10 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteStartObject(); writer.WritePropertyName("deletedByCommunicationIdentifier"u8); writer.WriteObjectValue(DeletedByCommunicationIdentifier, options); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -86,8 +92,8 @@ internal static AcsChatThreadDeletedEventData DeserializeAcsChatThreadDeletedEve return null; } CommunicationIdentifierModel deletedByCommunicationIdentifier = default; - DateTimeOffset deleteTime = default; - DateTimeOffset createTime = default; + DateTimeOffset? deleteTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -102,11 +108,19 @@ internal static AcsChatThreadDeletedEventData DeserializeAcsChatThreadDeletedEve } if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs index 68b39610ce9d..249893e1f9ee 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs @@ -14,16 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadDeletedEventData : AcsChatThreadEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. /// The communication identifier of the user who deleted the thread. - /// The deletion time of the thread. /// is null. - internal AcsChatThreadDeletedEventData(DateTimeOffset createTime, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(createTime) + internal AcsChatThreadDeletedEventData(CommunicationIdentifierModel deletedByCommunicationIdentifier) { Argument.AssertNotNull(deletedByCommunicationIdentifier, nameof(deletedByCommunicationIdentifier)); DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -34,7 +31,7 @@ internal AcsChatThreadDeletedEventData(DateTimeOffset createTime, CommunicationI /// The version of the thread. /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. - internal AcsChatThreadDeletedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadDeletedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) { DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; DeleteTime = deleteTime; @@ -48,6 +45,6 @@ internal AcsChatThreadDeletedEventData() /// The communication identifier of the user who deleted the thread. public CommunicationIdentifierModel DeletedByCommunicationIdentifier { get; } /// The deletion time of the thread. - public DateTimeOffset DeleteTime { get; } + public DateTimeOffset? DeleteTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs index 56eaaae150e5..5e3865c3147f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteStartObject(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -83,7 +86,7 @@ internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBa { return null; } - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -94,6 +97,10 @@ internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBa { if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs index d2a25d81594d..1ead8005f0c1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs @@ -15,13 +15,10 @@ public partial class AcsChatThreadEventBaseProperties : AcsChatEventBaseProperti { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// is null. - internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime) : base(recipientCommunicationIdentifier) + internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - - CreateTime = createTime; } /// Initializes a new instance of . @@ -31,7 +28,7 @@ internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipient /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. - internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) + internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) { CreateTime = createTime; Version = version; @@ -43,7 +40,7 @@ internal AcsChatThreadEventBaseProperties() } /// The original creation time of the thread. - public DateTimeOffset CreateTime { get; } + public DateTimeOffset? CreateTime { get; } /// The version of the thread. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs index 8b7c98aabf32..f2c1c8f7daac 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteStartObject(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -81,7 +84,7 @@ internal static AcsChatThreadEventInThreadBaseProperties DeserializeAcsChatThrea { return null; } - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -91,6 +94,10 @@ internal static AcsChatThreadEventInThreadBaseProperties DeserializeAcsChatThrea { if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs index 6f41f0fe85ee..511e7ddeba0e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs @@ -14,10 +14,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadEventInThreadBaseProperties : AcsChatEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. - internal AcsChatThreadEventInThreadBaseProperties(DateTimeOffset createTime) + internal AcsChatThreadEventInThreadBaseProperties() { - CreateTime = createTime; } /// Initializes a new instance of . @@ -26,19 +24,14 @@ internal AcsChatThreadEventInThreadBaseProperties(DateTimeOffset createTime) /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. - internal AcsChatThreadEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatThreadEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { CreateTime = createTime; Version = version; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadEventInThreadBaseProperties() - { - } - /// The original creation time of the thread. - public DateTimeOffset CreateTime { get; } + public DateTimeOffset? CreateTime { get; } /// The version of the thread. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs index c9701f563c00..a318236b35f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs @@ -28,8 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteStartObject(); writer.WritePropertyName("editedByCommunicationIdentifier"u8); writer.WriteObjectValue(EditedByCommunicationIdentifier, options); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); foreach (var item in Properties) @@ -58,8 +61,11 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -114,10 +120,10 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread return null; } CommunicationIdentifierModel editedByCommunicationIdentifier = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; IReadOnlyDictionary properties = default; IReadOnlyDictionary metadata = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -132,6 +138,10 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -164,6 +174,10 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs index 44f774f4f9a4..748afca8b6d6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs @@ -14,20 +14,17 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadPropertiesUpdatedEventData : AcsChatThreadEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. /// The communication identifier of the user who updated the thread properties. - /// The time at which the properties of the thread were updated. /// The updated thread properties. /// The thread metadata. /// , or is null. - internal AcsChatThreadPropertiesUpdatedEventData(DateTimeOffset createTime, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(createTime) + internal AcsChatThreadPropertiesUpdatedEventData(CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) { Argument.AssertNotNull(editedByCommunicationIdentifier, nameof(editedByCommunicationIdentifier)); Argument.AssertNotNull(properties, nameof(properties)); Argument.AssertNotNull(metadata, nameof(metadata)); EditedByCommunicationIdentifier = editedByCommunicationIdentifier; - EditTime = editTime; Properties = properties; Metadata = metadata; } @@ -42,7 +39,7 @@ internal AcsChatThreadPropertiesUpdatedEventData(DateTimeOffset createTime, Comm /// The time at which the properties of the thread were updated. /// The updated thread properties. /// The thread metadata. - internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -58,7 +55,7 @@ internal AcsChatThreadPropertiesUpdatedEventData() /// The communication identifier of the user who updated the thread properties. public CommunicationIdentifierModel EditedByCommunicationIdentifier { get; } /// The time at which the properties of the thread were updated. - public DateTimeOffset EditTime { get; } + public DateTimeOffset? EditTime { get; } /// /// The updated thread properties /// diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs index 6eb2f618ae84..125b74c9f7ea 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs @@ -28,8 +28,11 @@ void IJsonModel.Write(Utf8JsonWr writer.WriteStartObject(); writer.WritePropertyName("editedByCommunicationIdentifier"u8); writer.WriteObjectValue(EditedByCommunicationIdentifier, options); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); foreach (var item in Metadata) @@ -58,8 +61,11 @@ void IJsonModel.Write(Utf8JsonWr #endif } writer.WriteEndObject(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -116,10 +122,10 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha return null; } CommunicationIdentifierModel editedByCommunicationIdentifier = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; IReadOnlyDictionary metadata = default; IReadOnlyDictionary properties = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -135,6 +141,10 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -167,6 +177,10 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs index 571ff029f325..dc53eadefb4c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs @@ -15,13 +15,11 @@ public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : AcsChatThr { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// The communication identifier of the user who updated the thread properties. - /// The time at which the properties of the thread were updated. /// The thread metadata. /// The updated thread properties. /// , , or is null. - internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(editedByCommunicationIdentifier, nameof(editedByCommunicationIdentifier)); @@ -29,7 +27,6 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM Argument.AssertNotNull(properties, nameof(properties)); EditedByCommunicationIdentifier = editedByCommunicationIdentifier; - EditTime = editTime; Metadata = metadata; Properties = properties; } @@ -45,7 +42,7 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM /// The time at which the properties of the thread were updated. /// The thread metadata. /// The updated thread properties. - internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -61,7 +58,7 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData() /// The communication identifier of the user who updated the thread properties. public CommunicationIdentifierModel EditedByCommunicationIdentifier { get; } /// The time at which the properties of the thread were updated. - public DateTimeOffset EditTime { get; } + public DateTimeOffset? EditTime { get; } /// The thread metadata. public IReadOnlyDictionary Metadata { get; } /// diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs index 140744d9a62f..a771ac56e4fd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs @@ -28,10 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteStartObject(); writer.WritePropertyName("deletedByCommunicationIdentifier"u8); writer.WriteObjectValue(DeletedByCommunicationIdentifier, options); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -88,8 +94,8 @@ internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWi return null; } CommunicationIdentifierModel deletedByCommunicationIdentifier = default; - DateTimeOffset deleteTime = default; - DateTimeOffset createTime = default; + DateTimeOffset? deleteTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -105,11 +111,19 @@ internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWi } if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs index 2b366137bfd7..d0c52952554e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs @@ -15,17 +15,14 @@ public partial class AcsChatThreadWithUserDeletedEventData : AcsChatThreadEventB { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// The communication identifier of the user who deleted the thread. - /// The deletion time of the thread. /// or is null. - internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel deletedByCommunicationIdentifier) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(deletedByCommunicationIdentifier, nameof(deletedByCommunicationIdentifier)); DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -37,7 +34,7 @@ internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel reci /// The version of the thread. /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. - internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; DeleteTime = deleteTime; @@ -51,6 +48,6 @@ internal AcsChatThreadWithUserDeletedEventData() /// The communication identifier of the user who deleted the thread. public CommunicationIdentifierModel DeletedByCommunicationIdentifier { get; } /// The deletion time of the thread. - public DateTimeOffset DeleteTime { get; } + public DateTimeOffset? DeleteTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs index eb0dcfad8451..2526b1531166 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs @@ -41,12 +41,18 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } writer.WritePropertyName("deliveryStatusDetails"u8); writer.WriteObjectValue(DeliveryStatusDetails, options); - writer.WritePropertyName("deliveryAttemptTimeStamp"u8); - writer.WriteStringValue(DeliveryAttemptTimestamp, "O"); + if (Optional.IsDefined(DeliveryAttemptTimestamp)) + { + writer.WritePropertyName("deliveryAttemptTimestamp"u8); + writer.WriteStringValue(DeliveryAttemptTimestamp.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -88,9 +94,9 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv string sender = default; string recipient = default; string messageId = default; - AcsEmailDeliveryReportStatus status = default; + AcsEmailDeliveryReportStatus? status = default; AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = default; - DateTimeOffset deliveryAttemptTimeStamp = default; + DateTimeOffset? deliveryAttemptTimestamp = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -112,6 +118,10 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv } if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new AcsEmailDeliveryReportStatus(property.Value.GetString()); continue; } @@ -120,9 +130,13 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv deliveryStatusDetails = AcsEmailDeliveryReportStatusDetails.DeserializeAcsEmailDeliveryReportStatusDetails(property.Value, options); continue; } - if (property.NameEquals("deliveryAttemptTimeStamp"u8)) + if (property.NameEquals("deliveryAttemptTimestamp"u8)) { - deliveryAttemptTimeStamp = property.Value.GetDateTimeOffset("O"); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deliveryAttemptTimestamp = property.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") @@ -137,7 +151,7 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv messageId, status, deliveryStatusDetails, - deliveryAttemptTimeStamp, + deliveryAttemptTimestamp, serializedAdditionalRawData); } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs index f733218d6093..6b5ccc21acf3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs @@ -46,17 +46,13 @@ public partial class AcsEmailDeliveryReportReceivedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The status of the email. Any value other than Delivered is considered failed. /// Detailed information about the status if any. - /// The time at which the email delivery report received timestamp. /// is null. - internal AcsEmailDeliveryReportReceivedEventData(AcsEmailDeliveryReportStatus status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset deliveryAttemptTimestamp) + internal AcsEmailDeliveryReportReceivedEventData(AcsEmailDeliveryReportStatusDetails deliveryStatusDetails) { Argument.AssertNotNull(deliveryStatusDetails, nameof(deliveryStatusDetails)); - Status = status; DeliveryStatusDetails = deliveryStatusDetails; - DeliveryAttemptTimestamp = deliveryAttemptTimestamp; } /// Initializes a new instance of . @@ -67,7 +63,7 @@ internal AcsEmailDeliveryReportReceivedEventData(AcsEmailDeliveryReportStatus st /// Detailed information about the status if any. /// The time at which the email delivery report received timestamp. /// Keeps track of any properties unknown to the library. - internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient, string messageId, AcsEmailDeliveryReportStatus status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset deliveryAttemptTimestamp, IDictionary serializedAdditionalRawData) + internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient, string messageId, AcsEmailDeliveryReportStatus? status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset? deliveryAttemptTimestamp, IDictionary serializedAdditionalRawData) { Sender = sender; Recipient = recipient; @@ -90,10 +86,10 @@ internal AcsEmailDeliveryReportReceivedEventData() /// The Id of the email been sent. public string MessageId { get; } /// The status of the email. Any value other than Delivered is considered failed. - public AcsEmailDeliveryReportStatus Status { get; } + public AcsEmailDeliveryReportStatus? Status { get; } /// Detailed information about the status if any. public AcsEmailDeliveryReportStatusDetails DeliveryStatusDetails { get; } /// The time at which the email delivery report received timestamp. - public DateTimeOffset DeliveryAttemptTimestamp { get; } + public DateTimeOffset? DeliveryAttemptTimestamp { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs index e7b4a52f0c68..4cbac52b9288 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs @@ -41,8 +41,11 @@ void IJsonModel.Write(Utf8Jso writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); } - writer.WritePropertyName("userActionTimeStamp"u8); - writer.WriteStringValue(UserActionTimestamp, "O"); + if (Optional.IsDefined(UserActionTimestamp)) + { + writer.WritePropertyName("userActionTimestamp"u8); + writer.WriteStringValue(UserActionTimestamp.Value, "O"); + } if (Optional.IsDefined(EngagementContext)) { writer.WritePropertyName("engagementContext"u8); @@ -53,8 +56,11 @@ void IJsonModel.Write(Utf8Jso writer.WritePropertyName("userAgent"u8); writer.WriteStringValue(UserAgent); } - writer.WritePropertyName("engagementType"u8); - writer.WriteStringValue(Engagement.ToString()); + if (Optional.IsDefined(Engagement)) + { + writer.WritePropertyName("engagementType"u8); + writer.WriteStringValue(Engagement.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -96,10 +102,10 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs string sender = default; string recipient = default; string messageId = default; - DateTimeOffset userActionTimeStamp = default; + DateTimeOffset? userActionTimestamp = default; string engagementContext = default; string userAgent = default; - AcsUserEngagement engagementType = default; + AcsUserEngagement? engagementType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -119,9 +125,13 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs messageId = property.Value.GetString(); continue; } - if (property.NameEquals("userActionTimeStamp"u8)) + if (property.NameEquals("userActionTimestamp"u8)) { - userActionTimeStamp = property.Value.GetDateTimeOffset("O"); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userActionTimestamp = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("engagementContext"u8)) @@ -136,6 +146,10 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs } if (property.NameEquals("engagementType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } engagementType = new AcsUserEngagement(property.Value.GetString()); continue; } @@ -149,7 +163,7 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs sender, recipient, messageId, - userActionTimeStamp, + userActionTimestamp, engagementContext, userAgent, engagementType, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs index 9de2267639d7..78ece94104a5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs @@ -46,12 +46,8 @@ public partial class AcsEmailEngagementTrackingReportReceivedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the user interacted with the email. - /// The type of engagement user have with email. - internal AcsEmailEngagementTrackingReportReceivedEventData(DateTimeOffset userActionTimestamp, AcsUserEngagement engagement) + internal AcsEmailEngagementTrackingReportReceivedEventData() { - UserActionTimestamp = userActionTimestamp; - Engagement = engagement; } /// Initializes a new instance of . @@ -63,7 +59,7 @@ internal AcsEmailEngagementTrackingReportReceivedEventData(DateTimeOffset userAc /// The user agent interacting with the email. /// The type of engagement user have with email. /// Keeps track of any properties unknown to the library. - internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string recipient, string messageId, DateTimeOffset userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement engagement, IDictionary serializedAdditionalRawData) + internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string recipient, string messageId, DateTimeOffset? userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement? engagement, IDictionary serializedAdditionalRawData) { Sender = sender; Recipient = recipient; @@ -75,11 +71,6 @@ internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AcsEmailEngagementTrackingReportReceivedEventData() - { - } - /// The Sender Email Address. public string Sender { get; } /// The Recipient Email Address. @@ -87,12 +78,12 @@ internal AcsEmailEngagementTrackingReportReceivedEventData() /// The Id of the email that has been sent. public string MessageId { get; } /// The time at which the user interacted with the email. - public DateTimeOffset UserActionTimestamp { get; } + public DateTimeOffset? UserActionTimestamp { get; } /// The context of the type of engagement user had with email. public string EngagementContext { get; } /// The user agent interacting with the email. public string UserAgent { get; } /// The type of engagement user have with email. - public AcsUserEngagement Engagement { get; } + public AcsUserEngagement? Engagement { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs index 883ae3964591..488ef3417da5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs @@ -31,10 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("channelType"u8); - writer.WriteStringValue(ChannelKind.ToString()); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(ChannelKind)) + { + writer.WritePropertyName("channelType"u8); + writer.WriteStringValue(ChannelKind.Value.ToString()); + } if (Optional.IsDefined(From)) { writer.WritePropertyName("from"u8); @@ -45,8 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("to"u8); writer.WriteStringValue(To); } - writer.WritePropertyName("receivedTimeStamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimeStamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -88,11 +97,11 @@ internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDe return null; } string messageId = default; - AcsMessageDeliveryStatus status = default; - AcsMessageChannelKind channelType = default; + AcsMessageDeliveryStatus? status = default; + AcsMessageChannelKind? channelType = default; string @from = default; string to = default; - DateTimeOffset receivedTimeStamp = default; + DateTimeOffset? receivedTimeStamp = default; AcsMessageChannelEventError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -105,11 +114,19 @@ internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDe } if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new AcsMessageDeliveryStatus(property.Value.GetString()); continue; } if (property.NameEquals("channelType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } channelType = new AcsMessageChannelKind(property.Value.GetString()); continue; } @@ -125,6 +142,10 @@ internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDe } if (property.NameEquals("receivedTimeStamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimeStamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs index 08ee6836ec0e..f4bd6f681f1e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs @@ -14,17 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsMessageDeliveryStatusUpdatedEventData : AcsMessageEventData { /// Initializes a new instance of . - /// The time message was received. /// The channel event error. - /// The updated message status. - /// The updated message channel type. /// is null. - internal AcsMessageDeliveryStatusUpdatedEventData(DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, AcsMessageDeliveryStatus status, AcsMessageChannelKind channelKind) : base(receivedTimestamp, error) + internal AcsMessageDeliveryStatusUpdatedEventData(AcsMessageChannelEventError error) : base(error) { Argument.AssertNotNull(error, nameof(error)); - - Status = status; - ChannelKind = channelKind; } /// Initializes a new instance of . @@ -36,7 +30,7 @@ internal AcsMessageDeliveryStatusUpdatedEventData(DateTimeOffset receivedTimesta /// The message id. /// The updated message status. /// The updated message channel type. - internal AcsMessageDeliveryStatusUpdatedEventData(string @from, string to, DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string messageId, AcsMessageDeliveryStatus status, AcsMessageChannelKind channelKind) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) + internal AcsMessageDeliveryStatusUpdatedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string messageId, AcsMessageDeliveryStatus? status, AcsMessageChannelKind? channelKind) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) { MessageId = messageId; Status = status; @@ -51,8 +45,8 @@ internal AcsMessageDeliveryStatusUpdatedEventData() /// The message id. public string MessageId { get; } /// The updated message status. - public AcsMessageDeliveryStatus Status { get; } + public AcsMessageDeliveryStatus? Status { get; } /// The updated message channel type. - public AcsMessageChannelKind ChannelKind { get; } + public AcsMessageChannelKind? ChannelKind { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs index 88ba683f049b..85084fdd2334 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs @@ -36,8 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("to"u8); writer.WriteStringValue(To); } - writer.WritePropertyName("receivedTimeStamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimeStamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -80,7 +83,7 @@ internal static AcsMessageEventData DeserializeAcsMessageEventData(JsonElement e } string @from = default; string to = default; - DateTimeOffset receivedTimeStamp = default; + DateTimeOffset? receivedTimeStamp = default; AcsMessageChannelEventError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -98,6 +101,10 @@ internal static AcsMessageEventData DeserializeAcsMessageEventData(JsonElement e } if (property.NameEquals("receivedTimeStamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimeStamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs index cedcc1dc0758..7bcb742ac6ae 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs @@ -46,14 +46,12 @@ public partial class AcsMessageEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time message was received. /// The channel event error. /// is null. - internal AcsMessageEventData(DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error) + internal AcsMessageEventData(AcsMessageChannelEventError error) { Argument.AssertNotNull(error, nameof(error)); - ReceivedTimestamp = receivedTimestamp; Error = error; } @@ -63,7 +61,7 @@ internal AcsMessageEventData(DateTimeOffset receivedTimestamp, AcsMessageChannel /// The time message was received. /// The channel event error. /// Keeps track of any properties unknown to the library. - internal AcsMessageEventData(string @from, string to, DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData) + internal AcsMessageEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData) { From = @from; To = to; @@ -82,7 +80,7 @@ internal AcsMessageEventData() /// The message recipient. public string To { get; } /// The time message was received. - public DateTimeOffset ReceivedTimestamp { get; } + public DateTimeOffset? ReceivedTimestamp { get; } /// The channel event error. public AcsMessageChannelEventError Error { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs index cb1f26eb8cfc..4ca652c9c616 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ReplyKind.ToString()); + if (Optional.IsDefined(ReplyKind)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ReplyKind.Value.ToString()); + } writer.WritePropertyName("buttonReply"u8); writer.WriteObjectValue(ButtonReply, options); writer.WritePropertyName("listReply"u8); @@ -70,7 +73,7 @@ internal static AcsMessageInteractiveContent DeserializeAcsMessageInteractiveCon { return null; } - AcsInteractiveReplyKind type = default; + AcsInteractiveReplyKind? type = default; AcsMessageInteractiveButtonReplyContent buttonReply = default; AcsMessageInteractiveListReplyContent listReply = default; IDictionary serializedAdditionalRawData = default; @@ -79,6 +82,10 @@ internal static AcsMessageInteractiveContent DeserializeAcsMessageInteractiveCon { if (property.NameEquals("type"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } type = new AcsInteractiveReplyKind(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs index 0d59cf31c2ff..9b8cdb2ab40a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs @@ -46,16 +46,14 @@ public partial class AcsMessageInteractiveContent private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The Message interactive reply type. /// The Message Sent when a customer clicks a button. /// The Message Sent when a customer selects an item from a list. /// or is null. - internal AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply) + internal AcsMessageInteractiveContent(AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply) { Argument.AssertNotNull(buttonReply, nameof(buttonReply)); Argument.AssertNotNull(listReply, nameof(listReply)); - ReplyKind = replyKind; ButtonReply = buttonReply; ListReply = listReply; } @@ -65,7 +63,7 @@ internal AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind, AcsMess /// The Message Sent when a customer clicks a button. /// The Message Sent when a customer selects an item from a list. /// Keeps track of any properties unknown to the library. - internal AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply, IDictionary serializedAdditionalRawData) + internal AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply, IDictionary serializedAdditionalRawData) { ReplyKind = replyKind; ButtonReply = buttonReply; @@ -79,7 +77,7 @@ internal AcsMessageInteractiveContent() } /// The Message interactive reply type. - public AcsInteractiveReplyKind ReplyKind { get; } + public AcsInteractiveReplyKind? ReplyKind { get; } /// The Message Sent when a customer clicks a button. public AcsMessageInteractiveButtonReplyContent ButtonReply { get; } /// The Message Sent when a customer selects an item from a list. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs index e35e1bb137aa..f9d053bd7287 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs @@ -51,8 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("to"u8); writer.WriteStringValue(To); } - writer.WritePropertyName("receivedTimeStamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimeStamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -101,7 +104,7 @@ internal static AcsMessageReceivedEventData DeserializeAcsMessageReceivedEventDa AcsMessageInteractiveContent interactive = default; string @from = default; string to = default; - DateTimeOffset receivedTimeStamp = default; + DateTimeOffset? receivedTimeStamp = default; AcsMessageChannelEventError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -149,6 +152,10 @@ internal static AcsMessageReceivedEventData DeserializeAcsMessageReceivedEventDa } if (property.NameEquals("receivedTimeStamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimeStamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs index b7435b051bdf..a15a9991bdda 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs @@ -14,7 +14,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsMessageReceivedEventData : AcsMessageEventData { /// Initializes a new instance of . - /// The time message was received. /// The channel event error. /// The message channel type. /// The received message media content. @@ -22,7 +21,7 @@ public partial class AcsMessageReceivedEventData : AcsMessageEventData /// The received message button content. /// The received message interactive content. /// , , , or is null. - internal AcsMessageReceivedEventData(DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(receivedTimestamp, error) + internal AcsMessageReceivedEventData(AcsMessageChannelEventError error, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(error) { Argument.AssertNotNull(error, nameof(error)); Argument.AssertNotNull(mediaContent, nameof(mediaContent)); @@ -49,7 +48,7 @@ internal AcsMessageReceivedEventData(DateTimeOffset receivedTimestamp, AcsMessag /// The received message context. /// The received message button content. /// The received message interactive content. - internal AcsMessageReceivedEventData(string @from, string to, DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string content, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) + internal AcsMessageReceivedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string content, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) { Content = content; ChannelKind = channelKind; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs index 89ee1da445a1..51f9f6f344a9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs @@ -28,19 +28,31 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WriteStartObject(); writer.WritePropertyName("recordingStorageInfo"u8); writer.WriteObjectValue(RecordingStorageInfo, options); - writer.WritePropertyName("recordingStartTime"u8); - writer.WriteStringValue(RecordingStartTime, "O"); + if (Optional.IsDefined(RecordingStartTime)) + { + writer.WritePropertyName("recordingStartTime"u8); + writer.WriteStringValue(RecordingStartTime.Value, "O"); + } if (Optional.IsDefined(RecordingDurationMs)) { writer.WritePropertyName("recordingDurationMs"u8); writer.WriteNumberValue(RecordingDurationMs.Value); } - writer.WritePropertyName("recordingContentType"u8); - writer.WriteStringValue(RecordingContentType.ToString()); - writer.WritePropertyName("recordingChannelType"u8); - writer.WriteStringValue(RecordingChannelKind.ToString()); - writer.WritePropertyName("recordingFormatType"u8); - writer.WriteStringValue(RecordingFormatType.ToString()); + if (Optional.IsDefined(RecordingContentType)) + { + writer.WritePropertyName("recordingContentType"u8); + writer.WriteStringValue(RecordingContentType.Value.ToString()); + } + if (Optional.IsDefined(RecordingChannelKind)) + { + writer.WritePropertyName("recordingChannelType"u8); + writer.WriteStringValue(RecordingChannelKind.Value.ToString()); + } + if (Optional.IsDefined(RecordingFormatType)) + { + writer.WritePropertyName("recordingFormatType"u8); + writer.WriteStringValue(RecordingFormatType.Value.ToString()); + } if (Optional.IsDefined(SessionEndReason)) { writer.WritePropertyName("sessionEndReason"u8); @@ -85,11 +97,11 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi return null; } AcsRecordingStorageInfoProperties recordingStorageInfo = default; - DateTimeOffset recordingStartTime = default; + DateTimeOffset? recordingStartTime = default; long? recordingDurationMs = default; - RecordingContentType recordingContentType = default; - RecordingChannelType recordingChannelType = default; - RecordingFormatType recordingFormatType = default; + RecordingContentType? recordingContentType = default; + RecordingChannelType? recordingChannelType = default; + RecordingFormatType? recordingFormatType = default; string sessionEndReason = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -102,6 +114,10 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi } if (property.NameEquals("recordingStartTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingStartTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -116,16 +132,28 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi } if (property.NameEquals("recordingContentType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingContentType = new RecordingContentType(property.Value.GetString()); continue; } if (property.NameEquals("recordingChannelType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingChannelType = new RecordingChannelType(property.Value.GetString()); continue; } if (property.NameEquals("recordingFormatType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingFormatType = new RecordingFormatType(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs index a5e50aee2cc8..6e00dccf4760 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs @@ -47,20 +47,12 @@ public partial class AcsRecordingFileStatusUpdatedEventData /// Initializes a new instance of . /// The details of recording storage information. - /// The time at which the recording started. - /// The recording content type- AudioVideo, or Audio. - /// The recording channel type - Mixed, Unmixed. - /// The recording format type - Mp4, Mp3, Wav. /// is null. - internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset recordingStartTime, RecordingContentType recordingContentType, RecordingChannelType recordingChannelKind, RecordingFormatType recordingFormatType) + internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo) { Argument.AssertNotNull(recordingStorageInfo, nameof(recordingStorageInfo)); RecordingStorageInfo = recordingStorageInfo; - RecordingStartTime = recordingStartTime; - RecordingContentType = recordingContentType; - RecordingChannelKind = recordingChannelKind; - RecordingFormatType = recordingFormatType; } /// Initializes a new instance of . @@ -72,7 +64,7 @@ internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoPropertie /// The recording format type - Mp4, Mp3, Wav. /// The reason for ending recording session. /// Keeps track of any properties unknown to the library. - internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset recordingStartTime, long? recordingDurationMs, RecordingContentType recordingContentType, RecordingChannelType recordingChannelKind, RecordingFormatType recordingFormatType, string sessionEndReason, IDictionary serializedAdditionalRawData) + internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset? recordingStartTime, long? recordingDurationMs, RecordingContentType? recordingContentType, RecordingChannelType? recordingChannelKind, RecordingFormatType? recordingFormatType, string sessionEndReason, IDictionary serializedAdditionalRawData) { RecordingStorageInfo = recordingStorageInfo; RecordingStartTime = recordingStartTime; @@ -92,15 +84,15 @@ internal AcsRecordingFileStatusUpdatedEventData() /// The details of recording storage information. public AcsRecordingStorageInfoProperties RecordingStorageInfo { get; } /// The time at which the recording started. - public DateTimeOffset RecordingStartTime { get; } + public DateTimeOffset? RecordingStartTime { get; } /// The recording duration in milliseconds. public long? RecordingDurationMs { get; } /// The recording content type- AudioVideo, or Audio. - public RecordingContentType RecordingContentType { get; } + public RecordingContentType? RecordingContentType { get; } /// The recording channel type - Mixed, Unmixed. - public RecordingChannelType RecordingChannelKind { get; } + public RecordingChannelType? RecordingChannelKind { get; } /// The recording format type - Mp4, Mp3, Wav. - public RecordingFormatType RecordingFormatType { get; } + public RecordingFormatType? RecordingFormatType { get; } /// The reason for ending recording session. public string SessionEndReason { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs index abb876deca81..655772773de2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - writer.WritePropertyName("jobStatus"u8); - writer.WriteStringValue(JobStatus.ToString()); + if (Optional.IsDefined(JobStatus)) + { + writer.WritePropertyName("jobStatus"u8); + writer.WriteStringValue(JobStatus.Value.ToString()); + } if (Optional.IsDefined(ClassificationPolicyId)) { writer.WritePropertyName("classificationPolicyId"u8); @@ -45,8 +48,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("scheduledOn"u8); - writer.WriteStringValue(ScheduledOn, "O"); + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledOn"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } writer.WritePropertyName("unavailableForMatching"u8); writer.WriteBooleanValue(UnavailableForMatching); if (Optional.IsDefined(QueueId)) @@ -123,11 +129,11 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve { return null; } - AcsRouterJobStatus jobStatus = default; + AcsRouterJobStatus? jobStatus = default; string classificationPolicyId = default; int? priority = default; IReadOnlyList requestedWorkerSelectors = default; - DateTimeOffset scheduledOn = default; + DateTimeOffset? scheduledOn = default; bool unavailableForMatching = default; string queueId = default; IReadOnlyDictionary labels = default; @@ -141,6 +147,10 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve { if (property.NameEquals("jobStatus"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } jobStatus = new AcsRouterJobStatus(property.Value.GetString()); continue; } @@ -170,6 +180,10 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve } if (property.NameEquals("scheduledOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduledOn = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs index 3a5d5a136ea7..e13d3fb3647b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs @@ -17,20 +17,16 @@ public partial class AcsRouterJobReceivedEventData : AcsRouterJobEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// Router Job Received Job Status. /// Router Job Received Requested Worker Selectors. - /// Router Job Received Scheduled Time in UTC. /// Unavailable For Matching for Router Job Received. /// , or is null. - internal AcsRouterJobReceivedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus jobStatus, IEnumerable requestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(labels, tags) + internal AcsRouterJobReceivedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable requestedWorkerSelectors, bool unavailableForMatching) : base(labels, tags) { Argument.AssertNotNull(labels, nameof(labels)); Argument.AssertNotNull(tags, nameof(tags)); Argument.AssertNotNull(requestedWorkerSelectors, nameof(requestedWorkerSelectors)); - JobStatus = jobStatus; RequestedWorkerSelectors = requestedWorkerSelectors.ToList(); - ScheduledOn = scheduledOn; UnavailableForMatching = unavailableForMatching; } @@ -48,7 +44,7 @@ internal AcsRouterJobReceivedEventData(IReadOnlyDictionary label /// Router Job Received Requested Worker Selectors. /// Router Job Received Scheduled Time in UTC. /// Unavailable For Matching for Router Job Received. - internal AcsRouterJobReceivedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus jobStatus, string classificationPolicyId, int? priority, IReadOnlyList requestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobReceivedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus? jobStatus, string classificationPolicyId, int? priority, IReadOnlyList requestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) { JobStatus = jobStatus; ClassificationPolicyId = classificationPolicyId; @@ -64,7 +60,7 @@ internal AcsRouterJobReceivedEventData() } /// Router Job Received Job Status. - public AcsRouterJobStatus JobStatus { get; } + public AcsRouterJobStatus? JobStatus { get; } /// Router Job Classification Policy Id. public string ClassificationPolicyId { get; } /// Router Job Priority. @@ -72,7 +68,7 @@ internal AcsRouterJobReceivedEventData() /// Router Job Received Requested Worker Selectors. public IReadOnlyList RequestedWorkerSelectors { get; } /// Router Job Received Scheduled Time in UTC. - public DateTimeOffset ScheduledOn { get; } + public DateTimeOffset? ScheduledOn { get; } /// Unavailable For Matching for Router Job Received. public bool UnavailableForMatching { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs index c58f9f019aa8..b0a931a00cac 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs @@ -45,8 +45,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("scheduledOn"u8); - writer.WriteStringValue(ScheduledOn, "O"); + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledOn"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } if (Optional.IsDefined(FailureReason)) { writer.WritePropertyName("failureReason"u8); @@ -129,7 +132,7 @@ internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSch int? priority = default; IReadOnlyList expiredAttachedWorkerSelectors = default; IReadOnlyList expiredRequestedWorkerSelectors = default; - DateTimeOffset scheduledOn = default; + DateTimeOffset? scheduledOn = default; string failureReason = default; string queueId = default; IReadOnlyDictionary labels = default; @@ -172,6 +175,10 @@ internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSch } if (property.NameEquals("scheduledOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduledOn = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs index 6d55b80f185a..2f38f8a6466d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs @@ -19,9 +19,8 @@ public partial class AcsRouterJobSchedulingFailedEventData : AcsRouterJobEventDa /// Router Jobs events Tags. /// Router Job Scheduling Failed Attached Worker Selector Expired. /// Router Job Scheduling Failed Requested Worker Selector Expired. - /// Router Job Scheduling Failed Scheduled Time in UTC. /// , , or is null. - internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn) : base(labels, tags) + internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors) : base(labels, tags) { Argument.AssertNotNull(labels, nameof(labels)); Argument.AssertNotNull(tags, nameof(tags)); @@ -30,7 +29,6 @@ internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary Initializes a new instance of . @@ -46,7 +44,7 @@ internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary Router Job Scheduling Failed Requested Worker Selector Expired. /// Router Job Scheduling Failed Scheduled Time in UTC. /// Router Job Scheduling Failed Reason. - internal AcsRouterJobSchedulingFailedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn, string failureReason) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobSchedulingFailedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, string failureReason) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) { Priority = priority; ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; @@ -67,7 +65,7 @@ internal AcsRouterJobSchedulingFailedEventData() /// Router Job Scheduling Failed Requested Worker Selector Expired. public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } /// Router Job Scheduling Failed Scheduled Time in UTC. - public DateTimeOffset ScheduledOn { get; } + public DateTimeOffset? ScheduledOn { get; } /// Router Job Scheduling Failed Reason. public string FailureReason { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs index 887097bdd33a..628fb9c0a489 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs @@ -45,8 +45,11 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("scheduledOn"u8); - writer.WriteStringValue(ScheduledOn, "O"); + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledOn"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } writer.WritePropertyName("unavailableForMatching"u8); writer.WriteBooleanValue(UnavailableForMatching); if (Optional.IsDefined(QueueId)) @@ -126,7 +129,7 @@ internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJo int? priority = default; IReadOnlyList expiredAttachedWorkerSelectors = default; IReadOnlyList expiredRequestedWorkerSelectors = default; - DateTimeOffset scheduledOn = default; + DateTimeOffset? scheduledOn = default; bool unavailableForMatching = default; string queueId = default; IReadOnlyDictionary labels = default; @@ -169,6 +172,10 @@ internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJo } if (property.NameEquals("scheduledOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduledOn = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs index 445da526d6c0..df1a3085421f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs @@ -19,10 +19,9 @@ public partial class AcsRouterJobWaitingForActivationEventData : AcsRouterJobEve /// Router Jobs events Tags. /// Router Job Waiting For Activation Worker Selector Expired. /// Router Job Waiting For Activation Requested Worker Selector Expired. - /// Router Job Waiting For Activation Scheduled Time in UTC. /// Router Job Waiting For Activation Unavailable For Matching. /// , , or is null. - internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(labels, tags) + internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors, bool unavailableForMatching) : base(labels, tags) { Argument.AssertNotNull(labels, nameof(labels)); Argument.AssertNotNull(tags, nameof(tags)); @@ -31,7 +30,6 @@ internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary Router Job Waiting For Activation Requested Worker Selector Expired. /// Router Job Waiting For Activation Scheduled Time in UTC. /// Router Job Waiting For Activation Unavailable For Matching. - internal AcsRouterJobWaitingForActivationEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobWaitingForActivationEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) { Priority = priority; ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; @@ -69,7 +67,7 @@ internal AcsRouterJobWaitingForActivationEventData() /// Router Job Waiting For Activation Requested Worker Selector Expired. public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } /// Router Job Waiting For Activation Scheduled Time in UTC. - public DateTimeOffset ScheduledOn { get; } + public DateTimeOffset? ScheduledOn { get; } /// Router Job Waiting For Activation Unavailable For Matching. public bool UnavailableForMatching { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs index 9a1073b87251..ccf679cdea50 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs @@ -49,10 +49,16 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("offeredOn"u8); - writer.WriteStringValue(OfferedOn, "O"); - writer.WritePropertyName("expiresOn"u8); - writer.WriteStringValue(ExpiresOn, "O"); + if (Optional.IsDefined(OfferedOn)) + { + writer.WritePropertyName("offeredOn"u8); + writer.WriteStringValue(OfferedOn.Value, "O"); + } + if (Optional.IsDefined(ExpiresOn)) + { + writer.WritePropertyName("expiresOn"u8); + writer.WriteStringValue(ExpiresOn.Value, "O"); + } writer.WritePropertyName("workerTags"u8); writer.WriteStartObject(); foreach (var item in WorkerTags) @@ -139,8 +145,8 @@ internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOf string offerId = default; int? jobPriority = default; IReadOnlyDictionary workerLabels = default; - DateTimeOffset offeredOn = default; - DateTimeOffset expiresOn = default; + DateTimeOffset? offeredOn = default; + DateTimeOffset? expiresOn = default; IReadOnlyDictionary workerTags = default; IReadOnlyDictionary jobLabels = default; IReadOnlyDictionary jobTags = default; @@ -183,11 +189,19 @@ internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOf } if (property.NameEquals("offeredOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } offeredOn = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("expiresOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } expiresOn = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs index f964beba9d50..ac8aee0106c3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs @@ -15,13 +15,11 @@ public partial class AcsRouterWorkerOfferIssuedEventData : AcsRouterWorkerEventD { /// Initializes a new instance of . /// Router Worker Offer Issued Worker Labels. - /// Router Worker Offer Issued Time in UTC. - /// Router Worker Offer Issued Expiration Time in UTC. /// Router Worker Offer Issued Worker Tags. /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. /// , , or is null. - internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary workerLabels, DateTimeOffset offeredOn, DateTimeOffset expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) + internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary workerLabels, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) { Argument.AssertNotNull(workerLabels, nameof(workerLabels)); Argument.AssertNotNull(workerTags, nameof(workerTags)); @@ -29,8 +27,6 @@ internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary Argument.AssertNotNull(jobTags, nameof(jobTags)); WorkerLabels = workerLabels; - OfferedOn = offeredOn; - ExpiresOn = expiresOn; WorkerTags = workerTags; JobLabels = jobLabels; JobTags = jobTags; @@ -51,7 +47,7 @@ internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary /// Router Worker Offer Issued Worker Tags. /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. - internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId, string queueId, string offerId, int? jobPriority, IReadOnlyDictionary workerLabels, DateTimeOffset offeredOn, DateTimeOffset expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) + internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId, string queueId, string offerId, int? jobPriority, IReadOnlyDictionary workerLabels, DateTimeOffset? offeredOn, DateTimeOffset? expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) { QueueId = queueId; OfferId = offerId; @@ -78,9 +74,9 @@ internal AcsRouterWorkerOfferIssuedEventData() /// Router Worker Offer Issued Worker Labels. public IReadOnlyDictionary WorkerLabels { get; } /// Router Worker Offer Issued Time in UTC. - public DateTimeOffset OfferedOn { get; } + public DateTimeOffset? OfferedOn { get; } /// Router Worker Offer Issued Expiration Time in UTC. - public DateTimeOffset ExpiresOn { get; } + public DateTimeOffset? ExpiresOn { get; } /// Router Worker Offer Issued Worker Tags. public IReadOnlyDictionary WorkerTags { get; } /// Router Worker Offer Issued Job Labels. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs index bf357f3f303a..37c85b96aeb9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); } - writer.WritePropertyName("labelOperator"u8); - writer.WriteStringValue(LabelOperator.ToString()); + if (Optional.IsDefined(LabelOperator)) + { + writer.WritePropertyName("labelOperator"u8); + writer.WriteStringValue(LabelOperator.Value.ToString()); + } writer.WritePropertyName("value"u8); #if NET6_0_OR_GREATER writer.WriteRawValue(LabelValue); @@ -44,10 +47,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif writer.WritePropertyName("ttlSeconds"u8); writer.WriteNumberValue(TimeToLive); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(SelectorState.ToString()); - writer.WritePropertyName("expirationTime"u8); - writer.WriteStringValue(ExpirationTime, "O"); + if (Optional.IsDefined(SelectorState)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(SelectorState.Value.ToString()); + } + if (Optional.IsDefined(ExpirationTime)) + { + writer.WritePropertyName("expirationTime"u8); + writer.WriteStringValue(ExpirationTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -87,11 +96,11 @@ internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonE return null; } string key = default; - AcsRouterLabelOperator labelOperator = default; + AcsRouterLabelOperator? labelOperator = default; BinaryData value = default; double ttlSeconds = default; - AcsRouterWorkerSelectorState state = default; - DateTimeOffset expirationTime = default; + AcsRouterWorkerSelectorState? state = default; + DateTimeOffset? expirationTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -103,6 +112,10 @@ internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonE } if (property.NameEquals("labelOperator"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } labelOperator = new AcsRouterLabelOperator(property.Value.GetString()); continue; } @@ -118,11 +131,19 @@ internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonE } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new AcsRouterWorkerSelectorState(property.Value.GetString()); continue; } if (property.NameEquals("expirationTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } expirationTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs index 0de728036de4..fa8232506cbe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs @@ -46,21 +46,15 @@ public partial class AcsRouterWorkerSelector private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Router Job Worker Selector Label Operator. /// Router Job Worker Selector Value. /// Router Job Worker Selector Time to Live in Seconds. - /// Router Job Worker Selector State. - /// Router Job Worker Selector Expiration Time. /// is null. - internal AcsRouterWorkerSelector(AcsRouterLabelOperator labelOperator, BinaryData labelValue, double timeToLive, AcsRouterWorkerSelectorState selectorState, DateTimeOffset expirationTime) + internal AcsRouterWorkerSelector(BinaryData labelValue, double timeToLive) { Argument.AssertNotNull(labelValue, nameof(labelValue)); - LabelOperator = labelOperator; LabelValue = labelValue; TimeToLive = timeToLive; - SelectorState = selectorState; - ExpirationTime = expirationTime; } /// Initializes a new instance of . @@ -71,7 +65,7 @@ internal AcsRouterWorkerSelector(AcsRouterLabelOperator labelOperator, BinaryDat /// Router Job Worker Selector State. /// Router Job Worker Selector Expiration Time. /// Keeps track of any properties unknown to the library. - internal AcsRouterWorkerSelector(string key, AcsRouterLabelOperator labelOperator, BinaryData labelValue, double timeToLive, AcsRouterWorkerSelectorState selectorState, DateTimeOffset expirationTime, IDictionary serializedAdditionalRawData) + internal AcsRouterWorkerSelector(string key, AcsRouterLabelOperator? labelOperator, BinaryData labelValue, double timeToLive, AcsRouterWorkerSelectorState? selectorState, DateTimeOffset? expirationTime, IDictionary serializedAdditionalRawData) { Key = key; LabelOperator = labelOperator; @@ -90,7 +84,7 @@ internal AcsRouterWorkerSelector() /// Router Job Worker Selector Key. public string Key { get; } /// Router Job Worker Selector Label Operator. - public AcsRouterLabelOperator LabelOperator { get; } + public AcsRouterLabelOperator? LabelOperator { get; } /// /// Router Job Worker Selector Value /// @@ -125,8 +119,8 @@ internal AcsRouterWorkerSelector() /// Router Job Worker Selector Time to Live in Seconds. public double TimeToLive { get; } /// Router Job Worker Selector State. - public AcsRouterWorkerSelectorState SelectorState { get; } + public AcsRouterWorkerSelectorState? SelectorState { get; } /// Router Job Worker Selector Expiration Time. - public DateTimeOffset ExpirationTime { get; } + public DateTimeOffset? ExpirationTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs index 80548b839ba3..103fc7067f93 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(SegmentsSucceeded)) { writer.WritePropertyName("segmentsSucceeded"u8); @@ -76,7 +79,7 @@ internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttempt { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; int? segmentsSucceeded = default; int? segmentsFailed = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttempt { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs index 79cc8014347e..21453a993a3f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs @@ -46,10 +46,8 @@ public partial class AcsSmsDeliveryAttemptProperties private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// TimeStamp when delivery was attempted. - internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp) + internal AcsSmsDeliveryAttemptProperties() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -57,7 +55,7 @@ internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp) /// Number of segments that were successfully delivered. /// Number of segments whose delivery failed. /// Keeps track of any properties unknown to the library. - internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp, int? segmentsSucceeded, int? segmentsFailed, IDictionary serializedAdditionalRawData) + internal AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp, int? segmentsSucceeded, int? segmentsFailed, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; SegmentsSucceeded = segmentsSucceeded; @@ -65,13 +63,8 @@ internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp, int? segments _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AcsSmsDeliveryAttemptProperties() - { - } - /// TimeStamp when delivery was attempted. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// Number of segments that were successfully delivered. public int? SegmentsSucceeded { get; } /// Number of segments whose delivery failed. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs index b9d9ab9043f0..56655757187b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs @@ -43,8 +43,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("receivedTimestamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimestamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } if (Optional.IsDefined(Tag)) { writer.WritePropertyName("tag"u8); @@ -106,7 +109,7 @@ internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryR string deliveryStatus = default; string deliveryStatusDetails = default; IReadOnlyList deliveryAttempts = default; - DateTimeOffset receivedTimestamp = default; + DateTimeOffset? receivedTimestamp = default; string tag = default; string messageId = default; string @from = default; @@ -137,6 +140,10 @@ internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryR } if (property.NameEquals("receivedTimestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs index 3f14eeca621a..3e3649e9affe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs @@ -16,14 +16,12 @@ public partial class AcsSmsDeliveryReportReceivedEventData : AcsSmsEventBaseProp { /// Initializes a new instance of . /// List of details of delivery attempts made. - /// The time at which the SMS delivery report was received. /// is null. - internal AcsSmsDeliveryReportReceivedEventData(IEnumerable deliveryAttempts, DateTimeOffset receivedTimestamp) + internal AcsSmsDeliveryReportReceivedEventData(IEnumerable deliveryAttempts) { Argument.AssertNotNull(deliveryAttempts, nameof(deliveryAttempts)); DeliveryAttempts = deliveryAttempts.ToList(); - ReceivedTimestamp = receivedTimestamp; } /// Initializes a new instance of . @@ -36,7 +34,7 @@ internal AcsSmsDeliveryReportReceivedEventData(IEnumerable List of details of delivery attempts made. /// The time at which the SMS delivery report was received. /// Customer Content. - internal AcsSmsDeliveryReportReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string deliveryStatus, string deliveryStatusDetails, IReadOnlyList deliveryAttempts, DateTimeOffset receivedTimestamp, string tag) : base(messageId, @from, to, serializedAdditionalRawData) + internal AcsSmsDeliveryReportReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string deliveryStatus, string deliveryStatusDetails, IReadOnlyList deliveryAttempts, DateTimeOffset? receivedTimestamp, string tag) : base(messageId, @from, to, serializedAdditionalRawData) { DeliveryStatus = deliveryStatus; DeliveryStatusDetails = deliveryStatusDetails; @@ -57,7 +55,7 @@ internal AcsSmsDeliveryReportReceivedEventData() /// List of details of delivery attempts made. public IReadOnlyList DeliveryAttempts { get; } /// The time at which the SMS delivery report was received. - public DateTimeOffset ReceivedTimestamp { get; } + public DateTimeOffset? ReceivedTimestamp { get; } /// Customer Content. public string Tag { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs index 9d31fb716cde..bfda2ef8cd7e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - writer.WritePropertyName("receivedTimestamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimestamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -87,7 +90,7 @@ internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonE return null; } string message = default; - DateTimeOffset receivedTimestamp = default; + DateTimeOffset? receivedTimestamp = default; string messageId = default; string @from = default; string to = default; @@ -102,6 +105,10 @@ internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonE } if (property.NameEquals("receivedTimestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs index 75b7cdc072c2..3891a5e2fa73 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs @@ -14,10 +14,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsSmsReceivedEventData : AcsSmsEventBaseProperties { /// Initializes a new instance of . - /// The time at which the SMS was received. - internal AcsSmsReceivedEventData(DateTimeOffset receivedTimestamp) + internal AcsSmsReceivedEventData() { - ReceivedTimestamp = receivedTimestamp; } /// Initializes a new instance of . @@ -27,20 +25,15 @@ internal AcsSmsReceivedEventData(DateTimeOffset receivedTimestamp) /// Keeps track of any properties unknown to the library. /// The SMS content. /// The time at which the SMS was received. - internal AcsSmsReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string message, DateTimeOffset receivedTimestamp) : base(messageId, @from, to, serializedAdditionalRawData) + internal AcsSmsReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string message, DateTimeOffset? receivedTimestamp) : base(messageId, @from, to, serializedAdditionalRawData) { Message = message; ReceivedTimestamp = receivedTimestamp; } - /// Initializes a new instance of for deserialization. - internal AcsSmsReceivedEventData() - { - } - /// The SMS content. public string Message { get; } /// The time at which the SMS was received. - public DateTimeOffset ReceivedTimestamp { get; } + public DateTimeOffset? ReceivedTimestamp { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs index dd8ec339d1e5..b6036da6e5e1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteStartObject(); - writer.WritePropertyName("action"u8); - writer.WriteStringValue(Action.ToString()); + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -66,13 +69,17 @@ internal static AppEventTypeDetail DeserializeAppEventTypeDetail(JsonElement ele { return null; } - AppAction action = default; + AppAction? action = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("action"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } action = new AppAction(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs index 43550772de8f..236b12ab039c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs @@ -46,27 +46,20 @@ public partial class AppEventTypeDetail private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of action of the operation. - internal AppEventTypeDetail(AppAction action) + internal AppEventTypeDetail() { - Action = action; } /// Initializes a new instance of . /// Type of action of the operation. /// Keeps track of any properties unknown to the library. - internal AppEventTypeDetail(AppAction action, IDictionary serializedAdditionalRawData) + internal AppEventTypeDetail(AppAction? action, IDictionary serializedAdditionalRawData) { Action = action; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AppEventTypeDetail() - { - } - /// Type of action of the operation. - public AppAction Action { get; } + public AppAction? Action { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs index 08acdc74acc7..fbc2bc30f422 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs @@ -26,12 +26,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - writer.WritePropertyName("stampKind"u8); - writer.WriteStringValue(StampKind.ToString()); - writer.WritePropertyName("action"u8); - writer.WriteStringValue(Action.ToString()); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(StampKind)) + { + writer.WritePropertyName("stampKind"u8); + writer.WriteStringValue(StampKind.Value.ToString()); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -70,25 +79,37 @@ internal static AppServicePlanEventTypeDetail DeserializeAppServicePlanEventType { return null; } - StampKind stampKind = default; - AppServicePlanAction action = default; - AsyncStatus status = default; + StampKind? stampKind = default; + AppServicePlanAction? action = default; + AsyncStatus? status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("stampKind"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stampKind = new StampKind(property.Value.GetString()); continue; } if (property.NameEquals("action"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } action = new AppServicePlanAction(property.Value.GetString()); continue; } if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new AsyncStatus(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs index f4c61633045b..52cf7ca3592a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs @@ -46,14 +46,8 @@ public partial class AppServicePlanEventTypeDetail private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Kind of environment where app service plan is. - /// Type of action on the app service plan. - /// Asynchronous operation status of the operation on the app service plan. - internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction action, AsyncStatus status) + internal AppServicePlanEventTypeDetail() { - StampKind = stampKind; - Action = action; - Status = status; } /// Initializes a new instance of . @@ -61,7 +55,7 @@ internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction /// Type of action on the app service plan. /// Asynchronous operation status of the operation on the app service plan. /// Keeps track of any properties unknown to the library. - internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction action, AsyncStatus status, IDictionary serializedAdditionalRawData) + internal AppServicePlanEventTypeDetail(StampKind? stampKind, AppServicePlanAction? action, AsyncStatus? status, IDictionary serializedAdditionalRawData) { StampKind = stampKind; Action = action; @@ -69,16 +63,11 @@ internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AppServicePlanEventTypeDetail() - { - } - /// Kind of environment where app service plan is. - public StampKind StampKind { get; } + public StampKind? StampKind { get; } /// Type of action on the app service plan. - public AppServicePlanAction Action { get; } + public AppServicePlanAction? Action { get; } /// Asynchronous operation status of the operation on the app service plan. - public AsyncStatus Status { get; } + public AsyncStatus? Status { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs index ee382d67f2db..8f8c8383eb59 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } if (Optional.IsDefined(RawId)) { writer.WritePropertyName("rawId"u8); @@ -79,7 +82,7 @@ internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierM { return null; } - CommunicationIdentifierModelKind kind = default; + CommunicationIdentifierModelKind? kind = default; string rawId = default; CommunicationUserIdentifierModel communicationUser = default; PhoneNumberIdentifierModel phoneNumber = default; @@ -91,6 +94,10 @@ internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierM { if (property.NameEquals("kind"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } kind = new CommunicationIdentifierModelKind(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs index 391730bf3a99..00e7ea22dcd5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs @@ -46,20 +46,18 @@ public partial class CommunicationIdentifierModel private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The identifier kind. Only required in responses. /// The communication user. /// The phone number. /// The Microsoft Teams user. /// The Microsoft Teams application. /// , , or is null. - internal CommunicationIdentifierModel(CommunicationIdentifierModelKind kind, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp) + internal CommunicationIdentifierModel(CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp) { Argument.AssertNotNull(communicationUser, nameof(communicationUser)); Argument.AssertNotNull(phoneNumber, nameof(phoneNumber)); Argument.AssertNotNull(microsoftTeamsUser, nameof(microsoftTeamsUser)); Argument.AssertNotNull(microsoftTeamsApp, nameof(microsoftTeamsApp)); - Kind = kind; CommunicationUser = communicationUser; PhoneNumber = phoneNumber; MicrosoftTeamsUser = microsoftTeamsUser; @@ -74,7 +72,7 @@ internal CommunicationIdentifierModel(CommunicationIdentifierModelKind kind, Com /// The Microsoft Teams user. /// The Microsoft Teams application. /// Keeps track of any properties unknown to the library. - internal CommunicationIdentifierModel(CommunicationIdentifierModelKind kind, string rawId, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp, IDictionary serializedAdditionalRawData) + internal CommunicationIdentifierModel(CommunicationIdentifierModelKind? kind, string rawId, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp, IDictionary serializedAdditionalRawData) { Kind = kind; RawId = rawId; @@ -91,7 +89,7 @@ internal CommunicationIdentifierModel() } /// The identifier kind. Only required in responses. - public CommunicationIdentifierModelKind Kind { get; } + public CommunicationIdentifierModelKind? Kind { get; } /// Raw Id of the identifier. Optional in requests, required in responses. public string RawId { get; } /// The communication user. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs index e5ad95b47aec..fc59a5762926 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -86,7 +89,7 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryArtifactEventTarget target = default; @@ -102,6 +105,10 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs index 9fb1972e3d56..4f0d15c62790 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs @@ -46,16 +46,14 @@ public partial class ContainerRegistryArtifactEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// or is null. - internal ContainerRegistryArtifactEventData(DateTimeOffset timestamp, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) + internal ContainerRegistryArtifactEventData(ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); - Timestamp = timestamp; Target = target; ConnectedRegistry = connectedRegistry; } @@ -68,7 +66,7 @@ internal ContainerRegistryArtifactEventData(DateTimeOffset timestamp, ContainerR /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryArtifactEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) + internal ContainerRegistryArtifactEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) { Id = id; Timestamp = timestamp; @@ -87,7 +85,7 @@ internal ContainerRegistryArtifactEventData() /// The event ID. public string Id { get; } /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The action that encompasses the provided event. public string Action { get; } /// The location of the event. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs index 79582df5c7f6..7430e3eb3089 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -86,7 +89,7 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryArtifactEventTarget target = default; @@ -102,6 +105,10 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs index c51cacba09e9..1e84b783aed2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs @@ -14,11 +14,10 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryChartDeletedEventData : ContainerRegistryArtifactEventData { /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// or is null. - internal ContainerRegistryChartDeletedEventData(DateTimeOffset timestamp, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, connectedRegistry) + internal ContainerRegistryChartDeletedEventData(ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(target, connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); @@ -32,7 +31,7 @@ internal ContainerRegistryChartDeletedEventData(DateTimeOffset timestamp, Contai /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryChartDeletedEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) + internal ContainerRegistryChartDeletedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs index 026fad8fb588..ab8f85385723 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -86,7 +89,7 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryArtifactEventTarget target = default; @@ -102,6 +105,10 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs index 1e05ff576eac..276a12341e2f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs @@ -14,11 +14,10 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryChartPushedEventData : ContainerRegistryArtifactEventData { /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// or is null. - internal ContainerRegistryChartPushedEventData(DateTimeOffset timestamp, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, connectedRegistry) + internal ContainerRegistryChartPushedEventData(ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(target, connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); @@ -32,7 +31,7 @@ internal ContainerRegistryChartPushedEventData(DateTimeOffset timestamp, Contain /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryChartPushedEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) + internal ContainerRegistryChartPushedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs index 99e7b410c73a..7204aef8ab50 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -92,7 +95,7 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryEventTarget target = default; @@ -111,6 +114,10 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs index 6f9e05701bed..76f516a629a2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs @@ -46,14 +46,13 @@ public partial class ContainerRegistryEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The request that generated the event. /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// , , , or is null. - internal ContainerRegistryEventData(DateTimeOffset timestamp, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) + internal ContainerRegistryEventData(ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(request, nameof(request)); @@ -61,7 +60,6 @@ internal ContainerRegistryEventData(DateTimeOffset timestamp, ContainerRegistryE Argument.AssertNotNull(source, nameof(source)); Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); - Timestamp = timestamp; Target = target; Request = request; Actor = actor; @@ -80,7 +78,7 @@ internal ContainerRegistryEventData(DateTimeOffset timestamp, ContainerRegistryE /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) + internal ContainerRegistryEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) { Id = id; Timestamp = timestamp; @@ -102,7 +100,7 @@ internal ContainerRegistryEventData() /// The event ID. public string Id { get; } /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The action that encompasses the provided event. public string Action { get; } /// The location of the event. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs index 4455d40dd005..f8fd9a1db32d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -92,7 +95,7 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryEventTarget target = default; @@ -111,6 +114,10 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs index c839e9590b91..d6c928eaa580 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs @@ -14,14 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryImageDeletedEventData : ContainerRegistryEventData { /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The request that generated the event. /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// , , , or is null. - internal ContainerRegistryImageDeletedEventData(DateTimeOffset timestamp, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, request, actor, source, connectedRegistry) + internal ContainerRegistryImageDeletedEventData(ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(target, request, actor, source, connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(request, nameof(request)); @@ -41,7 +40,7 @@ internal ContainerRegistryImageDeletedEventData(DateTimeOffset timestamp, Contai /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryImageDeletedEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) + internal ContainerRegistryImageDeletedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs index c2b595879fe7..3672163ec71e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -92,7 +95,7 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryEventTarget target = default; @@ -111,6 +114,10 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs index 32fbf481e6df..429b19cf91b5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs @@ -14,14 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryImagePushedEventData : ContainerRegistryEventData { /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The request that generated the event. /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// , , , or is null. - internal ContainerRegistryImagePushedEventData(DateTimeOffset timestamp, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, request, actor, source, connectedRegistry) + internal ContainerRegistryImagePushedEventData(ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(target, request, actor, source, connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(request, nameof(request)); @@ -41,7 +40,7 @@ internal ContainerRegistryImagePushedEventData(DateTimeOffset timestamp, Contain /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryImagePushedEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) + internal ContainerRegistryImagePushedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs index 3abd95697358..f6d1c91fc3e6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs @@ -31,10 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("serialNumber"u8); writer.WriteStringValue(SerialNumber); } - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName.ToString()); - writer.WritePropertyName("stageTime"u8); - writer.WriteStringValue(StageTime, "O"); + if (Optional.IsDefined(StageName)) + { + writer.WritePropertyName("stageName"u8); + writer.WriteStringValue(StageName.Value.ToString()); + } + if (Optional.IsDefined(StageTime)) + { + writer.WritePropertyName("stageTime"u8); + writer.WriteStringValue(StageTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -74,8 +80,8 @@ internal static DataBoxCopyCompletedEventData DeserializeDataBoxCopyCompletedEve return null; } string serialNumber = default; - DataBoxStageName stageName = default; - DateTimeOffset stageTime = default; + DataBoxStageName? stageName = default; + DateTimeOffset? stageTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -87,11 +93,19 @@ internal static DataBoxCopyCompletedEventData DeserializeDataBoxCopyCompletedEve } if (property.NameEquals("stageName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageName = new DataBoxStageName(property.Value.GetString()); continue; } if (property.NameEquals("stageTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs index 75a73c0475e9..9ec03066cd5e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs @@ -46,12 +46,8 @@ public partial class DataBoxCopyCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the current Stage. - /// The time at which the stage happened. - internal DataBoxCopyCompletedEventData(DataBoxStageName stageName, DateTimeOffset stageTime) + internal DataBoxCopyCompletedEventData() { - StageName = stageName; - StageTime = stageTime; } /// Initializes a new instance of . @@ -59,7 +55,7 @@ internal DataBoxCopyCompletedEventData(DataBoxStageName stageName, DateTimeOffse /// Name of the current Stage. /// The time at which the stage happened. /// Keeps track of any properties unknown to the library. - internal DataBoxCopyCompletedEventData(string serialNumber, DataBoxStageName stageName, DateTimeOffset stageTime, IDictionary serializedAdditionalRawData) + internal DataBoxCopyCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) { SerialNumber = serialNumber; StageName = stageName; @@ -67,16 +63,11 @@ internal DataBoxCopyCompletedEventData(string serialNumber, DataBoxStageName sta _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DataBoxCopyCompletedEventData() - { - } - /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. public string SerialNumber { get; } /// Name of the current Stage. - public DataBoxStageName StageName { get; } + public DataBoxStageName? StageName { get; } /// The time at which the stage happened. - public DateTimeOffset StageTime { get; } + public DateTimeOffset? StageTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs index ba8950a8e9b2..e649959117c2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs @@ -31,10 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("serialNumber"u8); writer.WriteStringValue(SerialNumber); } - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName.ToString()); - writer.WritePropertyName("stageTime"u8); - writer.WriteStringValue(StageTime, "O"); + if (Optional.IsDefined(StageName)) + { + writer.WritePropertyName("stageName"u8); + writer.WriteStringValue(StageName.Value.ToString()); + } + if (Optional.IsDefined(StageTime)) + { + writer.WritePropertyName("stageTime"u8); + writer.WriteStringValue(StageTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -74,8 +80,8 @@ internal static DataBoxCopyStartedEventData DeserializeDataBoxCopyStartedEventDa return null; } string serialNumber = default; - DataBoxStageName stageName = default; - DateTimeOffset stageTime = default; + DataBoxStageName? stageName = default; + DateTimeOffset? stageTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -87,11 +93,19 @@ internal static DataBoxCopyStartedEventData DeserializeDataBoxCopyStartedEventDa } if (property.NameEquals("stageName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageName = new DataBoxStageName(property.Value.GetString()); continue; } if (property.NameEquals("stageTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs index 2c607fcec991..137e68ee45c7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs @@ -46,12 +46,8 @@ public partial class DataBoxCopyStartedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the current Stage. - /// The time at which the stage happened. - internal DataBoxCopyStartedEventData(DataBoxStageName stageName, DateTimeOffset stageTime) + internal DataBoxCopyStartedEventData() { - StageName = stageName; - StageTime = stageTime; } /// Initializes a new instance of . @@ -59,7 +55,7 @@ internal DataBoxCopyStartedEventData(DataBoxStageName stageName, DateTimeOffset /// Name of the current Stage. /// The time at which the stage happened. /// Keeps track of any properties unknown to the library. - internal DataBoxCopyStartedEventData(string serialNumber, DataBoxStageName stageName, DateTimeOffset stageTime, IDictionary serializedAdditionalRawData) + internal DataBoxCopyStartedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) { SerialNumber = serialNumber; StageName = stageName; @@ -67,16 +63,11 @@ internal DataBoxCopyStartedEventData(string serialNumber, DataBoxStageName stage _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DataBoxCopyStartedEventData() - { - } - /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. public string SerialNumber { get; } /// Name of the current Stage. - public DataBoxStageName StageName { get; } + public DataBoxStageName? StageName { get; } /// The time at which the stage happened. - public DateTimeOffset StageTime { get; } + public DateTimeOffset? StageTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs index 52901785663d..9139088ced83 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs @@ -31,10 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WritePropertyName("serialNumber"u8); writer.WriteStringValue(SerialNumber); } - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName.ToString()); - writer.WritePropertyName("stageTime"u8); - writer.WriteStringValue(StageTime, "O"); + if (Optional.IsDefined(StageName)) + { + writer.WritePropertyName("stageName"u8); + writer.WriteStringValue(StageName.Value.ToString()); + } + if (Optional.IsDefined(StageTime)) + { + writer.WritePropertyName("stageTime"u8); + writer.WriteStringValue(StageTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -74,8 +80,8 @@ internal static DataBoxOrderCompletedEventData DeserializeDataBoxOrderCompletedE return null; } string serialNumber = default; - DataBoxStageName stageName = default; - DateTimeOffset stageTime = default; + DataBoxStageName? stageName = default; + DateTimeOffset? stageTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -87,11 +93,19 @@ internal static DataBoxOrderCompletedEventData DeserializeDataBoxOrderCompletedE } if (property.NameEquals("stageName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageName = new DataBoxStageName(property.Value.GetString()); continue; } if (property.NameEquals("stageTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs index b610d5819b26..7e38471a034c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs @@ -46,12 +46,8 @@ public partial class DataBoxOrderCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the current Stage. - /// The time at which the stage happened. - internal DataBoxOrderCompletedEventData(DataBoxStageName stageName, DateTimeOffset stageTime) + internal DataBoxOrderCompletedEventData() { - StageName = stageName; - StageTime = stageTime; } /// Initializes a new instance of . @@ -59,7 +55,7 @@ internal DataBoxOrderCompletedEventData(DataBoxStageName stageName, DateTimeOffs /// Name of the current Stage. /// The time at which the stage happened. /// Keeps track of any properties unknown to the library. - internal DataBoxOrderCompletedEventData(string serialNumber, DataBoxStageName stageName, DateTimeOffset stageTime, IDictionary serializedAdditionalRawData) + internal DataBoxOrderCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) { SerialNumber = serialNumber; StageName = stageName; @@ -67,16 +63,11 @@ internal DataBoxOrderCompletedEventData(string serialNumber, DataBoxStageName st _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DataBoxOrderCompletedEventData() - { - } - /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. public string SerialNumber { get; } /// Name of the current Stage. - public DataBoxStageName StageName { get; } + public DataBoxStageName? StageName { get; } /// The time at which the stage happened. - public DateTimeOffset StageTime { get; } + public DateTimeOffset? StageTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs similarity index 72% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs index 49fb2fc01a8d..5048a122d6b6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs @@ -13,25 +13,34 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientCreatedOrUpdatedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); - writer.WritePropertyName("createdOn"u8); - writer.WriteStringValue(CreatedOn, "O"); - writer.WritePropertyName("updatedOn"u8); - writer.WriteStringValue(UpdatedOn, "O"); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdOn"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedOn"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } writer.WritePropertyName("attributes"u8); writer.WriteStartObject(); foreach (var item in Attributes) @@ -73,19 +82,19 @@ void IJsonModel.Write(Utf8JsonWrit writer.WriteEndObject(); } - EventGridMQTTClientCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement, options); } - internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientCreatedOrUpdatedEventData DeserializeEventGridMqttClientCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -93,9 +102,9 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri { return null; } - EventGridMQTTClientState state = default; - DateTimeOffset createdOn = default; - DateTimeOffset updatedOn = default; + EventGridMqttClientState? state = default; + DateTimeOffset? createdOn = default; + DateTimeOffset? updatedOn = default; IReadOnlyDictionary attributes = default; string clientAuthenticationName = default; string clientName = default; @@ -106,16 +115,28 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri { if (property.NameEquals("state"u8)) { - state = new EventGridMQTTClientState(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new EventGridMqttClientState(property.Value.GetString()); continue; } if (property.NameEquals("createdOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createdOn = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("updatedOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } updatedOn = property.Value.GetDateTimeOffset("O"); continue; } @@ -150,7 +171,7 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientCreatedOrUpdatedEventData( + return new EventGridMqttClientCreatedOrUpdatedEventData( clientAuthenticationName, clientName, namespaceName, @@ -161,43 +182,43 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri attributes); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientCreatedOrUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientCreatedOrUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new EventGridMQTTClientCreatedOrUpdatedEventData FromResponse(Response response) + internal static new EventGridMqttClientCreatedOrUpdatedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(document.RootElement); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs similarity index 66% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs index dde0c575b475..72730dd319f6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs @@ -11,29 +11,19 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientCreatedOrUpdated event. - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientCreatedOrUpdatedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - /// Configured state of the client. The value could be Enabled or Disabled. - /// Time the client resource is created based on the provider's UTC time. - /// - /// Time the client resource is last updated based on the provider's UTC time. If - /// the client resource was never updated, this value is identical to the value of - /// the 'createdOn' property. - /// + /// Initializes a new instance of . /// The key-value attributes that are assigned to the client resource. /// is null. - internal EventGridMQTTClientCreatedOrUpdatedEventData(EventGridMQTTClientState state, DateTimeOffset createdOn, DateTimeOffset updatedOn, IReadOnlyDictionary attributes) + internal EventGridMqttClientCreatedOrUpdatedEventData(IReadOnlyDictionary attributes) { Argument.AssertNotNull(attributes, nameof(attributes)); - State = state; - CreatedOn = createdOn; - UpdatedOn = updatedOn; Attributes = attributes; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -50,7 +40,7 @@ internal EventGridMQTTClientCreatedOrUpdatedEventData(EventGridMQTTClientState s /// the 'createdOn' property. /// /// The key-value attributes that are assigned to the client resource. - internal EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, EventGridMQTTClientState state, DateTimeOffset createdOn, DateTimeOffset updatedOn, IReadOnlyDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, EventGridMqttClientState? state, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IReadOnlyDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { State = state; CreatedOn = createdOn; @@ -58,21 +48,21 @@ internal EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticatio Attributes = attributes; } - /// Initializes a new instance of for deserialization. - internal EventGridMQTTClientCreatedOrUpdatedEventData() + /// Initializes a new instance of for deserialization. + internal EventGridMqttClientCreatedOrUpdatedEventData() { } /// Configured state of the client. The value could be Enabled or Disabled. - public EventGridMQTTClientState State { get; } + public EventGridMqttClientState? State { get; } /// Time the client resource is created based on the provider's UTC time. - public DateTimeOffset CreatedOn { get; } + public DateTimeOffset? CreatedOn { get; } /// /// Time the client resource is last updated based on the provider's UTC time. If /// the client resource was never updated, this value is identical to the value of /// the 'createdOn' property. /// - public DateTimeOffset UpdatedOn { get; } + public DateTimeOffset? UpdatedOn { get; } /// The key-value attributes that are assigned to the client resource. public IReadOnlyDictionary Attributes { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs similarity index 77% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs index 202ba7488023..d601458d16e8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientDeletedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteEndObject(); } - EventGridMQTTClientDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientDeletedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement, options); } - internal static EventGridMQTTClientDeletedEventData DeserializeEventGridMQTTClientDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientDeletedEventData DeserializeEventGridMqttClientDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -107,46 +107,46 @@ internal static EventGridMQTTClientDeletedEventData DeserializeEventGridMQTTClie } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); + return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientDeletedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new EventGridMQTTClientDeletedEventData FromResponse(Response response) + internal static new EventGridMqttClientDeletedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientDeletedEventData(document.RootElement); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs similarity index 81% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs index a5660854989a..fe2cbeabdd6c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs @@ -11,14 +11,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientDeleted event. - public partial class EventGridMQTTClientDeletedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientDeletedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - internal EventGridMQTTClientDeletedEventData() + /// Initializes a new instance of . + internal EventGridMqttClientDeletedEventData() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -27,7 +27,7 @@ internal EventGridMQTTClientDeletedEventData() /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. /// Keeps track of any properties unknown to the library. - internal EventGridMQTTClientDeletedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientDeletedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDisconnectionReason.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs similarity index 64% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDisconnectionReason.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs index f8a93ea73d8f..a01f9343b34f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDisconnectionReason.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs @@ -11,13 +11,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// EventGrid MQTT Client Disconnection Reason. - public readonly partial struct EventGridMQTTClientDisconnectionReason : IEquatable + public readonly partial struct EventGridMqttClientDisconnectionReason : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public EventGridMQTTClientDisconnectionReason(string value) + public EventGridMqttClientDisconnectionReason(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -35,39 +35,39 @@ public EventGridMQTTClientDisconnectionReason(string value) private const string SessionTakenOverValue = "SessionTakenOver"; /// The client got disconnected for any authentication reasons (for example, certificate expired, client got disabled, or client configuration changed). - public static EventGridMQTTClientDisconnectionReason ClientAuthenticationError { get; } = new EventGridMQTTClientDisconnectionReason(ClientAuthenticationErrorValue); + public static EventGridMqttClientDisconnectionReason ClientAuthenticationError { get; } = new EventGridMqttClientDisconnectionReason(ClientAuthenticationErrorValue); /// The client got disconnected for any authorization reasons (for example, because of a change in the configuration of topic spaces, permission bindings, or client groups). - public static EventGridMQTTClientDisconnectionReason ClientAuthorizationError { get; } = new EventGridMQTTClientDisconnectionReason(ClientAuthorizationErrorValue); + public static EventGridMqttClientDisconnectionReason ClientAuthorizationError { get; } = new EventGridMqttClientDisconnectionReason(ClientAuthorizationErrorValue); /// The client sent a bad request or used one of the unsupported features that resulted in a connection termination by the service. - public static EventGridMQTTClientDisconnectionReason ClientError { get; } = new EventGridMQTTClientDisconnectionReason(ClientErrorValue); + public static EventGridMqttClientDisconnectionReason ClientError { get; } = new EventGridMqttClientDisconnectionReason(ClientErrorValue); /// The client initiated a graceful disconnect through a DISCONNECT packet for MQTT or a close frame for MQTT over WebSocket. - public static EventGridMQTTClientDisconnectionReason ClientInitiatedDisconnect { get; } = new EventGridMQTTClientDisconnectionReason(ClientInitiatedDisconnectValue); + public static EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get; } = new EventGridMqttClientDisconnectionReason(ClientInitiatedDisconnectValue); /// The client-server connection is lost. (EXCHANGE ONLINE PROTECTION). - public static EventGridMQTTClientDisconnectionReason ConnectionLost { get; } = new EventGridMQTTClientDisconnectionReason(ConnectionLostValue); + public static EventGridMqttClientDisconnectionReason ConnectionLost { get; } = new EventGridMqttClientDisconnectionReason(ConnectionLostValue); /// The client's IP address is blocked by IP filter or Private links configuration. - public static EventGridMQTTClientDisconnectionReason IpForbidden { get; } = new EventGridMQTTClientDisconnectionReason(IpForbiddenValue); + public static EventGridMqttClientDisconnectionReason IpForbidden { get; } = new EventGridMqttClientDisconnectionReason(IpForbiddenValue); /// The client exceeded one or more of the throttling limits that resulted in a connection termination by the service. - public static EventGridMQTTClientDisconnectionReason QuotaExceeded { get; } = new EventGridMQTTClientDisconnectionReason(QuotaExceededValue); + public static EventGridMqttClientDisconnectionReason QuotaExceeded { get; } = new EventGridMqttClientDisconnectionReason(QuotaExceededValue); /// The connection got terminated due to an unexpected server error. - public static EventGridMQTTClientDisconnectionReason ServerError { get; } = new EventGridMQTTClientDisconnectionReason(ServerErrorValue); + public static EventGridMqttClientDisconnectionReason ServerError { get; } = new EventGridMqttClientDisconnectionReason(ServerErrorValue); /// The server initiates a graceful disconnect for any operational reason. - public static EventGridMQTTClientDisconnectionReason ServerInitiatedDisconnect { get; } = new EventGridMQTTClientDisconnectionReason(ServerInitiatedDisconnectValue); + public static EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get; } = new EventGridMqttClientDisconnectionReason(ServerInitiatedDisconnectValue); /// The client's queue for unacknowledged QoS1 messages reached its limit, which resulted in a connection termination by the server. - public static EventGridMQTTClientDisconnectionReason SessionOverflow { get; } = new EventGridMQTTClientDisconnectionReason(SessionOverflowValue); + public static EventGridMqttClientDisconnectionReason SessionOverflow { get; } = new EventGridMqttClientDisconnectionReason(SessionOverflowValue); /// The client reconnected with the same authentication name, which resulted in the termination of the previous connection. - public static EventGridMQTTClientDisconnectionReason SessionTakenOver { get; } = new EventGridMQTTClientDisconnectionReason(SessionTakenOverValue); - /// Determines if two values are the same. - public static bool operator ==(EventGridMQTTClientDisconnectionReason left, EventGridMQTTClientDisconnectionReason right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EventGridMQTTClientDisconnectionReason left, EventGridMQTTClientDisconnectionReason right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator EventGridMQTTClientDisconnectionReason(string value) => new EventGridMQTTClientDisconnectionReason(value); + public static EventGridMqttClientDisconnectionReason SessionTakenOver { get; } = new EventGridMqttClientDisconnectionReason(SessionTakenOverValue); + /// Determines if two values are the same. + public static bool operator ==(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EventGridMqttClientDisconnectionReason(string value) => new EventGridMqttClientDisconnectionReason(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EventGridMQTTClientDisconnectionReason other && Equals(other); + public override bool Equals(object obj) => obj is EventGridMqttClientDisconnectionReason other && Equals(other); /// - public bool Equals(EventGridMQTTClientDisconnectionReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(EventGridMqttClientDisconnectionReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs similarity index 78% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs index b34b7eb136fe..6df34fcf65c0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - EventGridMQTTClientEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientEventData(document.RootElement, options); + return DeserializeEventGridMqttClientEventData(document.RootElement, options); } - internal static EventGridMQTTClientEventData DeserializeEventGridMQTTClientEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientEventData DeserializeEventGridMqttClientEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -107,46 +107,46 @@ internal static EventGridMQTTClientEventData DeserializeEventGridMQTTClientEvent } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); + return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientEventData(document.RootElement, options); + return DeserializeEventGridMqttClientEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static EventGridMQTTClientEventData FromResponse(Response response) + internal static EventGridMqttClientEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientEventData(document.RootElement); + return DeserializeEventGridMqttClientEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs similarity index 93% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs index 8c69eb51fec2..0dd6c22cfee5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs @@ -11,7 +11,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for MQTT Client state changes. - public partial class EventGridMQTTClientEventData + public partial class EventGridMqttClientEventData { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +45,12 @@ public partial class EventGridMQTTClientEventData /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal EventGridMQTTClientEventData() + /// Initializes a new instance of . + internal EventGridMqttClientEventData() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -59,7 +59,7 @@ internal EventGridMQTTClientEventData() /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. /// Keeps track of any properties unknown to the library. - internal EventGridMQTTClientEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) + internal EventGridMqttClientEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) { ClientAuthenticationName = clientAuthenticationName; ClientName = clientName; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs similarity index 81% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs index b3a900803938..abc1054608d0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientSessionConnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientSessionConnectedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -69,19 +69,19 @@ void IJsonModel.Write(Utf8JsonWrit writer.WriteEndObject(); } - EventGridMQTTClientSessionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientSessionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientSessionConnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement, options); } - internal static EventGridMQTTClientSessionConnectedEventData DeserializeEventGridMQTTClientSessionConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientSessionConnectedEventData DeserializeEventGridMqttClientSessionConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -133,7 +133,7 @@ internal static EventGridMQTTClientSessionConnectedEventData DeserializeEventGri } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientSessionConnectedEventData( + return new EventGridMqttClientSessionConnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -142,43 +142,43 @@ internal static EventGridMQTTClientSessionConnectedEventData DeserializeEventGri sequenceNumber); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientSessionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientSessionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientSessionConnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new EventGridMQTTClientSessionConnectedEventData FromResponse(Response response) + internal static new EventGridMqttClientSessionConnectedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientSessionConnectedEventData(document.RootElement); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs similarity index 88% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs index 3a8dcde09042..755f075c2a35 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs @@ -11,14 +11,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientSessionConnected event. - public partial class EventGridMQTTClientSessionConnectedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientSessionConnectedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - internal EventGridMQTTClientSessionConnectedEventData() + /// Initializes a new instance of . + internal EventGridMqttClientSessionConnectedEventData() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -36,7 +36,7 @@ internal EventGridMQTTClientSessionConnectedEventData() /// disconnected events. Latest event will have a sequence number that is higher /// than the previous event. /// - internal EventGridMQTTClientSessionConnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { ClientSessionName = clientSessionName; SequenceNumber = sequenceNumber; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs similarity index 77% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs index 77166f0c803c..b3900d971e47 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientSessionDisconnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientSessionDisconnectedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -36,8 +36,11 @@ void IJsonModel.Write(Utf8JsonW writer.WritePropertyName("sequenceNumber"u8); writer.WriteNumberValue(SequenceNumber.Value); } - writer.WritePropertyName("disconnectionReason"u8); - writer.WriteStringValue(DisconnectionReason.ToString()); + if (Optional.IsDefined(DisconnectionReason)) + { + writer.WritePropertyName("disconnectionReason"u8); + writer.WriteStringValue(DisconnectionReason.Value.ToString()); + } if (Optional.IsDefined(ClientAuthenticationName)) { writer.WritePropertyName("clientAuthenticationName"u8); @@ -71,19 +74,19 @@ void IJsonModel.Write(Utf8JsonW writer.WriteEndObject(); } - EventGridMQTTClientSessionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientSessionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientSessionDisconnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement, options); } - internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEventGridMQTTClientSessionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientSessionDisconnectedEventData DeserializeEventGridMqttClientSessionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -93,7 +96,7 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent } string clientSessionName = default; long? sequenceNumber = default; - EventGridMQTTClientDisconnectionReason disconnectionReason = default; + EventGridMqttClientDisconnectionReason? disconnectionReason = default; string clientAuthenticationName = default; string clientName = default; string namespaceName = default; @@ -117,7 +120,11 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent } if (property.NameEquals("disconnectionReason"u8)) { - disconnectionReason = new EventGridMQTTClientDisconnectionReason(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disconnectionReason = new EventGridMqttClientDisconnectionReason(property.Value.GetString()); continue; } if (property.NameEquals("clientAuthenticationName"u8)) @@ -141,7 +148,7 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientSessionDisconnectedEventData( + return new EventGridMqttClientSessionDisconnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -151,43 +158,43 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent disconnectionReason); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientSessionDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientSessionDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientSessionDisconnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new EventGridMQTTClientSessionDisconnectedEventData FromResponse(Response response) + internal static new EventGridMqttClientSessionDisconnectedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientSessionDisconnectedEventData(document.RootElement); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs similarity index 72% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs index 2f9fcb7f6158..64de1dbf64a2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs @@ -11,19 +11,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientSessionDisconnected event. - public partial class EventGridMQTTClientSessionDisconnectedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientSessionDisconnectedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - /// - /// Reason for the disconnection of the MQTT client's session. The value could be - /// one of the values in the disconnection reasons table. - /// - internal EventGridMQTTClientSessionDisconnectedEventData(EventGridMQTTClientDisconnectionReason disconnectionReason) + /// Initializes a new instance of . + internal EventGridMqttClientSessionDisconnectedEventData() { - DisconnectionReason = disconnectionReason; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -45,18 +40,13 @@ internal EventGridMQTTClientSessionDisconnectedEventData(EventGridMQTTClientDisc /// Reason for the disconnection of the MQTT client's session. The value could be /// one of the values in the disconnection reasons table. /// - internal EventGridMQTTClientSessionDisconnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber, EventGridMQTTClientDisconnectionReason disconnectionReason) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber, EventGridMqttClientDisconnectionReason? disconnectionReason) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { ClientSessionName = clientSessionName; SequenceNumber = sequenceNumber; DisconnectionReason = disconnectionReason; } - /// Initializes a new instance of for deserialization. - internal EventGridMQTTClientSessionDisconnectedEventData() - { - } - /// /// Unique identifier for the MQTT client's session. This case-sensitive string can /// be up to 128 characters long, and supports UTF-8 characters. @@ -72,6 +62,6 @@ internal EventGridMQTTClientSessionDisconnectedEventData() /// Reason for the disconnection of the MQTT client's session. The value could be /// one of the values in the disconnection reasons table. /// - public EventGridMQTTClientDisconnectionReason DisconnectionReason { get; } + public EventGridMqttClientDisconnectionReason? DisconnectionReason { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientState.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs similarity index 59% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientState.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs index bebc9f25a2ab..676053abaa4d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientState.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs @@ -11,13 +11,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// EventGrid MQTT Client State. - public readonly partial struct EventGridMQTTClientState : IEquatable + public readonly partial struct EventGridMqttClientState : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public EventGridMQTTClientState(string value) + public EventGridMqttClientState(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -26,21 +26,21 @@ public EventGridMQTTClientState(string value) private const string DisabledValue = "Disabled"; /// Enabled. - public static EventGridMQTTClientState Enabled { get; } = new EventGridMQTTClientState(EnabledValue); + public static EventGridMqttClientState Enabled { get; } = new EventGridMqttClientState(EnabledValue); /// Disabled. - public static EventGridMQTTClientState Disabled { get; } = new EventGridMQTTClientState(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(EventGridMQTTClientState left, EventGridMQTTClientState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EventGridMQTTClientState left, EventGridMQTTClientState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator EventGridMQTTClientState(string value) => new EventGridMQTTClientState(value); + public static EventGridMqttClientState Disabled { get; } = new EventGridMqttClientState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(EventGridMqttClientState left, EventGridMqttClientState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EventGridMqttClientState left, EventGridMqttClientState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EventGridMqttClientState(string value) => new EventGridMqttClientState(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EventGridMQTTClientState other && Equals(other); + public override bool Equals(object obj) => obj is EventGridMqttClientState other && Equals(other); /// - public bool Equals(EventGridMQTTClientState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(EventGridMqttClientState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs index 3b3868356788..e8b8fa9728a6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs @@ -526,7 +526,7 @@ public static AcsIncomingCallEventData AcsIncomingCallEventData(CommunicationIde /// The Microsoft Teams user. /// The Microsoft Teams application. /// A new instance for mocking. - public static CommunicationIdentifierModel CommunicationIdentifierModel(CommunicationIdentifierModelKind kind = default, string rawId = null, CommunicationUserIdentifierModel communicationUser = null, PhoneNumberIdentifierModel phoneNumber = null, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) + public static CommunicationIdentifierModel CommunicationIdentifierModel(CommunicationIdentifierModelKind? kind = null, string rawId = null, CommunicationUserIdentifierModel communicationUser = null, PhoneNumberIdentifierModel phoneNumber = null, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { return new CommunicationIdentifierModel( kind, @@ -559,7 +559,7 @@ public static PhoneNumberIdentifierModel PhoneNumberIdentifierModel(string value /// True if the Microsoft Teams user is anonymous. By default false if missing. /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. /// A new instance for mocking. - public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = null, CommunicationCloudEnvironmentModel cloud = default) + public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = null, CommunicationCloudEnvironmentModel? cloud = null) { return new MicrosoftTeamsUserIdentifierModel(userId, isAnonymous, cloud, serializedAdditionalRawData: null); } @@ -568,7 +568,7 @@ public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierMode /// The Id of the Microsoft Teams application. /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. /// A new instance for mocking. - public static MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, CommunicationCloudEnvironmentModel cloud = default) + public static MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, CommunicationCloudEnvironmentModel? cloud = null) { return new MicrosoftTeamsAppIdentifierModel(appId, cloud, serializedAdditionalRawData: null); } @@ -623,7 +623,7 @@ public static AcsChatEventInThreadBaseProperties AcsChatEventInThreadBasePropert /// The type of the message. /// The version of the message. /// A new instance for mocking. - public static AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null) + public static AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null) { return new AcsChatMessageEventBaseProperties( recipientCommunicationIdentifier, @@ -651,7 +651,7 @@ public static AcsChatMessageEventBaseProperties AcsChatMessageEventBasePropertie /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) { metadata ??= new Dictionary(); @@ -680,7 +680,7 @@ public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Co /// The type of the message. /// The version of the message. /// A new instance for mocking. - public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null) + public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null) { return new AcsChatMessageEventInThreadBaseProperties( transactionId, @@ -706,7 +706,7 @@ public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThr /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) { metadata ??= new Dictionary(); @@ -738,7 +738,7 @@ public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInTh /// The chat message metadata. /// The time at which the message was edited. /// A new instance for mocking. - public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset editTime = default) + public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset? editTime = null) { metadata ??= new Dictionary(); @@ -771,7 +771,7 @@ public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Commun /// The chat message metadata. /// The time at which the message was edited. /// A new instance for mocking. - public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset editTime = default) + public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset? editTime = null) { metadata ??= new Dictionary(); @@ -802,7 +802,7 @@ public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThread /// The version of the message. /// The time at which the message was deleted. /// A new instance for mocking. - public static AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, DateTimeOffset deleteTime = default) + public static AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, DateTimeOffset? deleteTime = null) { return new AcsChatMessageDeletedEventData( recipientCommunicationIdentifier, @@ -829,7 +829,7 @@ public static AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Comm /// The version of the message. /// The time at which the message was deleted. /// A new instance for mocking. - public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, DateTimeOffset deleteTime = default) + public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, DateTimeOffset? deleteTime = null) { return new AcsChatMessageDeletedInThreadEventData( transactionId, @@ -851,7 +851,7 @@ public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThre /// The original creation time of the thread. /// The version of the thread. /// A new instance for mocking. - public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null) + public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null) { return new AcsChatThreadEventBaseProperties( recipientCommunicationIdentifier, @@ -873,7 +873,7 @@ public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties( /// The thread metadata. /// The list of properties of participants who are part of the thread. /// A new instance for mocking. - public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) + public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) { properties ??= new Dictionary(); metadata ??= new Dictionary(); @@ -910,7 +910,7 @@ public static AcsChatThreadParticipantProperties AcsChatThreadParticipantPropert /// The original creation time of the thread. /// The version of the thread. /// A new instance for mocking. - public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null) + public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null) { return new AcsChatThreadEventInThreadBaseProperties(transactionId, threadId, serializedAdditionalRawData: null, createTime, version); } @@ -925,7 +925,7 @@ public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThrea /// The thread metadata. /// The list of properties of participants who are part of the thread. /// A new instance for mocking. - public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) + public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) { properties ??= new Dictionary(); metadata ??= new Dictionary(); @@ -952,7 +952,7 @@ public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. /// A new instance for mocking. - public static AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset deleteTime = default) + public static AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset? deleteTime = null) { return new AcsChatThreadWithUserDeletedEventData( recipientCommunicationIdentifier, @@ -973,7 +973,7 @@ public static AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeleted /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. /// A new instance for mocking. - public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset deleteTime = default) + public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset? deleteTime = null) { return new AcsChatThreadDeletedEventData( transactionId, @@ -996,7 +996,7 @@ public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string /// The thread metadata. /// The updated thread properties. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset editTime = default, IReadOnlyDictionary metadata = null, IReadOnlyDictionary properties = null) + public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset? editTime = null, IReadOnlyDictionary metadata = null, IReadOnlyDictionary properties = null) { metadata ??= new Dictionary(); properties ??= new Dictionary(); @@ -1024,7 +1024,7 @@ public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadProper /// The updated thread properties. /// The thread metadata. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset editTime = default, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null) + public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset? editTime = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null) { properties ??= new Dictionary(); metadata ??= new Dictionary(); @@ -1051,7 +1051,7 @@ public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpd /// The communication identifier of the user who added the user. /// The details of the user who was added. /// A new instance for mocking. - public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, DateTimeOffset time = default, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null) + public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, DateTimeOffset? time = null, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null) { return new AcsChatParticipantAddedToThreadWithUserEventData( recipientCommunicationIdentifier, @@ -1075,7 +1075,7 @@ public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipan /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// A new instance for mocking. - public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, DateTimeOffset time = default, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null) + public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, DateTimeOffset? time = null, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null) { return new AcsChatParticipantRemovedFromThreadWithUserEventData( recipientCommunicationIdentifier, @@ -1097,7 +1097,7 @@ public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatPartic /// The details of the user who was added. /// The version of the thread. /// A new instance for mocking. - public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset time = default, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null, long? version = null) + public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset? time = null, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null, long? version = null) { return new AcsChatParticipantAddedToThreadEventData( transactionId, @@ -1117,7 +1117,7 @@ public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedTo /// The details of the user who was removed. /// The version of the thread. /// A new instance for mocking. - public static AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset time = default, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null, long? version = null) + public static AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset? time = null, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null, long? version = null) { return new AcsChatParticipantRemovedFromThreadEventData( transactionId, @@ -1149,7 +1149,7 @@ public static AcsSmsEventBaseProperties AcsSmsEventBaseProperties(string message /// The time at which the SMS delivery report was received. /// Customer Content. /// A new instance for mocking. - public static AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string @from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, IEnumerable deliveryAttempts = null, DateTimeOffset receivedTimestamp = default, string tag = null) + public static AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string @from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, IEnumerable deliveryAttempts = null, DateTimeOffset? receivedTimestamp = null, string tag = null) { deliveryAttempts ??= new List(); @@ -1170,7 +1170,7 @@ public static AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceived /// Number of segments that were successfully delivered. /// Number of segments whose delivery failed. /// A new instance for mocking. - public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp = default, int? segmentsSucceeded = null, int? segmentsFailed = null) + public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp = null, int? segmentsSucceeded = null, int? segmentsFailed = null) { return new AcsSmsDeliveryAttemptProperties(timestamp, segmentsSucceeded, segmentsFailed, serializedAdditionalRawData: null); } @@ -1182,7 +1182,7 @@ public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(Da /// The SMS content. /// The time at which the SMS was received. /// A new instance for mocking. - public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string @from = null, string to = null, string message = null, DateTimeOffset receivedTimestamp = default) + public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string @from = null, string to = null, string message = null, DateTimeOffset? receivedTimestamp = null) { return new AcsSmsReceivedEventData( messageId, @@ -1202,7 +1202,7 @@ public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = /// The recording format type - Mp4, Mp3, Wav. /// The reason for ending recording session. /// A new instance for mocking. - public static AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo = null, DateTimeOffset recordingStartTime = default, long? recordingDurationMs = null, RecordingContentType recordingContentType = default, RecordingChannelType recordingChannelKind = default, RecordingFormatType recordingFormatType = default, string sessionEndReason = null) + public static AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo = null, DateTimeOffset? recordingStartTime = null, long? recordingDurationMs = null, RecordingContentType? recordingContentType = null, RecordingChannelType? recordingChannelKind = null, RecordingFormatType? recordingFormatType = null, string sessionEndReason = null) { return new AcsRecordingFileStatusUpdatedEventData( recordingStorageInfo, @@ -1253,7 +1253,7 @@ public static AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(st /// Detailed information about the status if any. /// The time at which the email delivery report received timestamp. /// A new instance for mocking. - public static AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, AcsEmailDeliveryReportStatus status = default, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, DateTimeOffset deliveryAttemptTimestamp = default) + public static AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, AcsEmailDeliveryReportStatus? status = null, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, DateTimeOffset? deliveryAttemptTimestamp = null) { return new AcsEmailDeliveryReportReceivedEventData( sender, @@ -1282,7 +1282,7 @@ public static AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDe /// The user agent interacting with the email. /// The type of engagement user have with email. /// A new instance for mocking. - public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, DateTimeOffset userActionTimestamp = default, string engagementContext = null, string userAgent = null, AcsUserEngagement engagement = default) + public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, DateTimeOffset? userActionTimestamp = null, string engagementContext = null, string userAgent = null, AcsUserEngagement? engagement = null) { return new AcsEmailEngagementTrackingReportReceivedEventData( sender, @@ -1455,7 +1455,7 @@ public static AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, stri /// Router Job Worker Selector State. /// Router Job Worker Selector Expiration Time. /// A new instance for mocking. - public static AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, AcsRouterLabelOperator labelOperator = default, BinaryData labelValue = null, double timeToLive = default, AcsRouterWorkerSelectorState selectorState = default, DateTimeOffset expirationTime = default) + public static AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, AcsRouterLabelOperator? labelOperator = null, BinaryData labelValue = null, double timeToLive = default, AcsRouterWorkerSelectorState? selectorState = null, DateTimeOffset? expirationTime = null) { return new AcsRouterWorkerSelector( key, @@ -1618,7 +1618,7 @@ public static AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string job /// Router Job Received Scheduled Time in UTC. /// Unavailable For Matching for Router Job Received. /// A new instance for mocking. - public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, AcsRouterJobStatus jobStatus = default, string classificationPolicyId = null, int? priority = null, IEnumerable requestedWorkerSelectors = null, DateTimeOffset scheduledOn = default, bool unavailableForMatching = default) + public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, AcsRouterJobStatus? jobStatus = null, string classificationPolicyId = null, int? priority = null, IEnumerable requestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) { labels ??= new Dictionary(); tags ??= new Dictionary(); @@ -1653,7 +1653,7 @@ public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string /// Router Job Scheduling Failed Scheduled Time in UTC. /// Router Job Scheduling Failed Reason. /// A new instance for mocking. - public static AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset scheduledOn = default, string failureReason = null) + public static AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, string failureReason = null) { labels ??= new Dictionary(); tags ??= new Dictionary(); @@ -1715,7 +1715,7 @@ public static AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(st /// Router Job Waiting For Activation Scheduled Time in UTC. /// Router Job Waiting For Activation Unavailable For Matching. /// A new instance for mocking. - public static AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset scheduledOn = default, bool unavailableForMatching = default) + public static AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) { labels ??= new Dictionary(); tags ??= new Dictionary(); @@ -1888,7 +1888,7 @@ public static AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEv /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. /// A new instance for mocking. - public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = null, IReadOnlyDictionary workerLabels = null, DateTimeOffset offeredOn = default, DateTimeOffset expiresOn = default, IReadOnlyDictionary workerTags = null, IReadOnlyDictionary jobLabels = null, IReadOnlyDictionary jobTags = null) + public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = null, IReadOnlyDictionary workerLabels = null, DateTimeOffset? offeredOn = null, DateTimeOffset? expiresOn = null, IReadOnlyDictionary workerTags = null, IReadOnlyDictionary jobLabels = null, IReadOnlyDictionary jobTags = null) { workerLabels ??= new Dictionary(); workerTags ??= new Dictionary(); @@ -2001,7 +2001,7 @@ public static AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(st /// The time message was received. /// The channel event error. /// A new instance for mocking. - public static AcsMessageEventData AcsMessageEventData(string @from = null, string to = null, DateTimeOffset receivedTimestamp = default, AcsMessageChannelEventError error = null) + public static AcsMessageEventData AcsMessageEventData(string @from = null, string to = null, DateTimeOffset? receivedTimestamp = null, AcsMessageChannelEventError error = null) { return new AcsMessageEventData(@from, to, receivedTimestamp, error, serializedAdditionalRawData: null); } @@ -2024,7 +2024,7 @@ public static AcsMessageChannelEventError AcsMessageChannelEventError(string cha /// The updated message status. /// The updated message channel type. /// A new instance for mocking. - public static AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string @from = null, string to = null, DateTimeOffset receivedTimestamp = default, AcsMessageChannelEventError error = null, string messageId = null, AcsMessageDeliveryStatus status = default, AcsMessageChannelKind channelKind = default) + public static AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string @from = null, string to = null, DateTimeOffset? receivedTimestamp = null, AcsMessageChannelEventError error = null, string messageId = null, AcsMessageDeliveryStatus? status = null, AcsMessageChannelKind? channelKind = null) { return new AcsMessageDeliveryStatusUpdatedEventData( @from, @@ -2049,7 +2049,7 @@ public static AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusU /// The received message button content. /// The received message interactive content. /// A new instance for mocking. - public static AcsMessageReceivedEventData AcsMessageReceivedEventData(string @from = null, string to = null, DateTimeOffset receivedTimestamp = default, AcsMessageChannelEventError error = null, string content = null, AcsMessageChannelKind channelKind = default, AcsMessageMediaContent mediaContent = null, AcsMessageContext context = null, AcsMessageButtonContent button = null, AcsMessageInteractiveContent interactiveContent = null) + public static AcsMessageReceivedEventData AcsMessageReceivedEventData(string @from = null, string to = null, DateTimeOffset? receivedTimestamp = null, AcsMessageChannelEventError error = null, string content = null, AcsMessageChannelKind channelKind = default, AcsMessageMediaContent mediaContent = null, AcsMessageContext context = null, AcsMessageButtonContent button = null, AcsMessageInteractiveContent interactiveContent = null) { return new AcsMessageReceivedEventData( @from, @@ -2099,7 +2099,7 @@ public static AcsMessageButtonContent AcsMessageButtonContent(string text = null /// The Message Sent when a customer clicks a button. /// The Message Sent when a customer selects an item from a list. /// A new instance for mocking. - public static AcsMessageInteractiveContent AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind = default, AcsMessageInteractiveButtonReplyContent buttonReply = null, AcsMessageInteractiveListReplyContent listReply = null) + public static AcsMessageInteractiveContent AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind = null, AcsMessageInteractiveButtonReplyContent buttonReply = null, AcsMessageInteractiveListReplyContent listReply = null) { return new AcsMessageInteractiveContent(replyKind, buttonReply, listReply, serializedAdditionalRawData: null); } @@ -2134,7 +2134,7 @@ public static AcsMessageInteractiveListReplyContent AcsMessageInteractiveListRep /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryEventData ContainerRegistryEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryEventData ContainerRegistryEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryEventData( id, @@ -2225,7 +2225,7 @@ public static ContainerRegistryEventConnectedRegistry ContainerRegistryEventConn /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryImagePushedEventData( id, @@ -2251,7 +2251,7 @@ public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushed /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryImageDeletedEventData( id, @@ -2274,7 +2274,7 @@ public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDelet /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryArtifactEventData( id, @@ -2316,7 +2316,7 @@ public static ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEven /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryChartPushedEventData( id, @@ -2336,7 +2336,7 @@ public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushed /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryChartDeletedEventData( id, @@ -2420,7 +2420,7 @@ public static ContainerServiceNodePoolRollingFailedEventData ContainerServiceNod /// Name of the current Stage. /// The time at which the stage happened. /// A new instance for mocking. - public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, DataBoxStageName stageName = default, DateTimeOffset stageTime = default) + public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) { return new DataBoxCopyStartedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); } @@ -2430,7 +2430,7 @@ public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string ser /// Name of the current Stage. /// The time at which the stage happened. /// A new instance for mocking. - public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, DataBoxStageName stageName = default, DateTimeOffset stageTime = default) + public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) { return new DataBoxCopyCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); } @@ -2440,7 +2440,7 @@ public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string /// Name of the current Stage. /// The time at which the stage happened. /// A new instance for mocking. - public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, DataBoxStageName stageName = default, DateTimeOffset stageTime = default) + public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) { return new DataBoxOrderCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); } @@ -2456,7 +2456,7 @@ public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(stri /// The first time from the queue. /// The last time from the queue. /// A new instance for mocking. - public static EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = null, int? eventCount = null, int? firstSequenceNumber = null, int? lastSequenceNumber = null, DateTimeOffset firstEnqueueTime = default, DateTimeOffset lastEnqueueTime = default) + public static EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = null, int? eventCount = null, int? firstSequenceNumber = null, int? lastSequenceNumber = null, DateTimeOffset? firstEnqueueTime = null, DateTimeOffset? lastEnqueueTime = null) { return new EventHubCaptureFileCreatedEventData( fileurl, @@ -2721,7 +2721,7 @@ public static IotHubDeviceTelemetryEventData IotHubDeviceTelemetryEventData(IRea /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// A new instance for mocking. - public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirResourceType = default, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) { return new HealthcareFhirResourceCreatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); } @@ -2732,7 +2732,7 @@ public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreat /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// A new instance for mocking. - public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirResourceType = default, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) { return new HealthcareFhirResourceUpdatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); } @@ -2743,7 +2743,7 @@ public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdat /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// A new instance for mocking. - public static HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirResourceType = default, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) { return new HealthcareFhirResourceDeletedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); } @@ -3096,7 +3096,7 @@ public static MachineLearningServicesRunCompletedEventData MachineLearningServic /// The start time of the target dataset time series that resulted in drift detection. /// The end time of the target dataset time series that resulted in drift detection. /// A new instance for mocking. - public static MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = null, DateTimeOffset startTime = default, DateTimeOffset endTime = default) + public static MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = null, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null) { return new MachineLearningServicesDatasetDriftDetectedEventData( dataDriftId, @@ -3140,7 +3140,7 @@ public static MachineLearningServicesRunStatusChangedEventData MachineLearningSe /// The new state of the Job. /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobStateChangeEventData MediaJobStateChangeEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) + public static MediaJobStateChangeEventData MediaJobStateChangeEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null) { correlationData ??= new Dictionary(); @@ -3154,7 +3154,7 @@ public static MediaJobStateChangeEventData MediaJobStateChangeEventData(MediaJob /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. /// An array of details about specific errors that led to this reported error. /// A new instance for mocking. - public static MediaJobError MediaJobError(MediaJobErrorCode code = default, string message = null, MediaJobErrorCategory category = default, MediaJobRetry retry = default, IEnumerable details = null) + public static MediaJobError MediaJobError(MediaJobErrorCode? code = null, string message = null, MediaJobErrorCategory? category = null, MediaJobRetry? retry = null, IEnumerable details = null) { details ??= new List(); @@ -3183,7 +3183,7 @@ public static MediaJobErrorDetail MediaJobErrorDetail(string code = null, string /// Gets the Job output progress. /// Gets the Job output state. /// A new instance for mocking. - public static MediaJobOutput MediaJobOutput(string odataType = null, MediaJobError error = null, string label = null, long progress = default, MediaJobState state = default) + public static MediaJobOutput MediaJobOutput(string odataType = null, MediaJobError error = null, string label = null, long progress = default, MediaJobState? state = null) { return new UnknownMediaJobOutput( odataType, @@ -3201,7 +3201,7 @@ public static MediaJobOutput MediaJobOutput(string odataType = null, MediaJobErr /// Gets the Job output state. /// Gets the Job output asset name. /// A new instance for mocking. - public static MediaJobOutputAsset MediaJobOutputAsset(MediaJobError error = null, string label = null, long progress = default, MediaJobState state = default, string assetName = null) + public static MediaJobOutputAsset MediaJobOutputAsset(MediaJobError error = null, string label = null, long progress = default, MediaJobState? state = null, string assetName = null) { return new MediaJobOutputAsset( "#Microsoft.Media.JobOutputAsset", @@ -3234,7 +3234,7 @@ public static MediaJobOutputProgressEventData MediaJobOutputProgressEventData(st /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3246,7 +3246,7 @@ public static MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventD /// The new state of the Job. /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobScheduledEventData MediaJobScheduledEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) + public static MediaJobScheduledEventData MediaJobScheduledEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null) { correlationData ??= new Dictionary(); @@ -3258,7 +3258,7 @@ public static MediaJobScheduledEventData MediaJobScheduledEventData(MediaJobStat /// The new state of the Job. /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobProcessingEventData MediaJobProcessingEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) + public static MediaJobProcessingEventData MediaJobProcessingEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null) { correlationData ??= new Dictionary(); @@ -3270,7 +3270,7 @@ public static MediaJobProcessingEventData MediaJobProcessingEventData(MediaJobSt /// The new state of the Job. /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobCancelingEventData MediaJobCancelingEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) + public static MediaJobCancelingEventData MediaJobCancelingEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null) { correlationData ??= new Dictionary(); @@ -3287,7 +3287,7 @@ public static MediaJobCancelingEventData MediaJobCancelingEventData(MediaJobStat /// The available derived classes include . /// /// A new instance for mocking. - public static MediaJobFinishedEventData MediaJobFinishedEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) + public static MediaJobFinishedEventData MediaJobFinishedEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) { correlationData ??= new Dictionary(); outputs ??= new List(); @@ -3305,7 +3305,7 @@ public static MediaJobFinishedEventData MediaJobFinishedEventData(MediaJobState /// The available derived classes include . /// /// A new instance for mocking. - public static MediaJobCanceledEventData MediaJobCanceledEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) + public static MediaJobCanceledEventData MediaJobCanceledEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) { correlationData ??= new Dictionary(); outputs ??= new List(); @@ -3323,7 +3323,7 @@ public static MediaJobCanceledEventData MediaJobCanceledEventData(MediaJobState /// The available derived classes include . /// /// A new instance for mocking. - public static MediaJobErroredEventData MediaJobErroredEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) + public static MediaJobErroredEventData MediaJobErroredEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) { correlationData ??= new Dictionary(); outputs ??= new List(); @@ -3340,7 +3340,7 @@ public static MediaJobErroredEventData MediaJobErroredEventData(MediaJobState pr /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3356,7 +3356,7 @@ public static MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(Me /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3372,7 +3372,7 @@ public static MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData( /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputErroredEventData MediaJobOutputErroredEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputErroredEventData MediaJobOutputErroredEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3388,7 +3388,7 @@ public static MediaJobOutputErroredEventData MediaJobOutputErroredEventData(Medi /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3404,7 +3404,7 @@ public static MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(Me /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3420,7 +3420,7 @@ public static MediaJobOutputProcessingEventData MediaJobOutputProcessingEventDat /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3638,7 +3638,7 @@ public static MediaLiveEventChannelArchiveHeartbeatEventData MediaLiveEventChann /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp = default, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp = null, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { return new PolicyInsightsPolicyStateCreatedEventData( timestamp, @@ -3660,7 +3660,7 @@ public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStat /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp = default, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp = null, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { return new PolicyInsightsPolicyStateChangedEventData( timestamp, @@ -3682,7 +3682,7 @@ public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStat /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp = default, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp = null, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { return new PolicyInsightsPolicyStateDeletedEventData( timestamp, @@ -3700,7 +3700,7 @@ public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStat /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { return new RedisPatchingCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } @@ -3710,29 +3710,29 @@ public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(Da /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisScalingCompletedEventData RedisScalingCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + public static RedisScalingCompletedEventData RedisScalingCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { return new RedisScalingCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. - /// A new instance for mocking. - public static RedisExportRDBCompletedEventData RedisExportRDBCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + /// A new instance for mocking. + public static RedisExportRdbCompletedEventData RedisExportRdbCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { - return new RedisExportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisExportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. - /// A new instance for mocking. - public static RedisImportRDBCompletedEventData RedisImportRDBCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + /// A new instance for mocking. + public static RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { - return new RedisImportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisImportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -4132,7 +4132,7 @@ public static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventDat /// The connection Id of connected client connection. /// The user Id of connected client connection. /// A new instance for mocking. - public static SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timestamp = default, string hubName = null, string connectionId = null, string userId = null) + public static SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp = null, string hubName = null, string connectionId = null, string userId = null) { return new SignalRServiceClientConnectionConnectedEventData(timestamp, hubName, connectionId, userId, serializedAdditionalRawData: null); } @@ -4144,7 +4144,7 @@ public static SignalRServiceClientConnectionConnectedEventData SignalRServiceCli /// The user Id of connected client connection. /// The message of error that cause the client connection disconnected. /// A new instance for mocking. - public static SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset timestamp = default, string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) + public static SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp = null, string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { return new SignalRServiceClientConnectionDisconnectedEventData( timestamp, @@ -4164,12 +4164,13 @@ public static SignalRServiceClientConnectionDisconnectedEventData SignalRService /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = null, long? contentOffset = null, string blobType = null, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) + public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = null, long? contentOffset = null, string blobType = null, StorageBlobAccessTier accessTier = default, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) { storageDiagnostics ??= new Dictionary(); @@ -4182,6 +4183,7 @@ public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, @@ -4349,12 +4351,14 @@ public static StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyAc /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) + public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, StorageBlobAccessTier accessTier = default, StorageBlobAccessTier previousTier = default, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) { storageDiagnostics ??= new Dictionary(); @@ -4365,6 +4369,8 @@ public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(st contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, @@ -4411,7 +4417,7 @@ public static StorageAsyncOperationInitiatedEventData StorageAsyncOperationIniti /// The policy run id for inventory run. /// The blob URL for manifest file for inventory run. /// A new instance for mocking. - public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDateTime = default, string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) + public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDateTime = null, string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { return new StorageBlobInventoryPolicyCompletedEventData( scheduleDateTime, @@ -4431,7 +4437,7 @@ public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryP /// The task name for a storage task. /// The summary report blob url for a storage task. /// A new instance for mocking. - public static StorageTaskCompletedEventData StorageTaskCompletedEventData(StorageTaskCompletedStatus status = default, DateTimeOffset completedDateTime = default, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUrl = null) + public static StorageTaskCompletedEventData StorageTaskCompletedEventData(StorageTaskCompletedStatus? status = null, DateTimeOffset? completedDateTime = null, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUrl = null) { return new StorageTaskCompletedEventData( status, @@ -4446,7 +4452,7 @@ public static StorageTaskCompletedEventData StorageTaskCompletedEventData(Storag /// The time at which a storage task was queued. /// The execution id for a storage task. /// A new instance for mocking. - public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffset queuedDateTime = default, string taskExecutionId = null) + public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime = null, string taskExecutionId = null) { return new StorageTaskQueuedEventData(queuedDateTime, taskExecutionId, serializedAdditionalRawData: null); } @@ -4455,7 +4461,7 @@ public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffs /// The time at which a storage task was queued. /// The execution id for a storage task. /// A new instance for mocking. - public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(DateTimeOffset queuedOn = default, string taskExecutionId = null) + public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn = null, string taskExecutionId = null) { return new StorageTaskAssignmentQueuedEventData(queuedOn, taskExecutionId, serializedAdditionalRawData: null); } @@ -4467,7 +4473,7 @@ public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEv /// The task name for a storage task. /// The summary report blob url for a storage task. /// A new instance for mocking. - public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus status = default, DateTimeOffset completedOn = default, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUri = null) + public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status = null, DateTimeOffset? completedOn = null, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUri = null) { return new StorageTaskAssignmentCompletedEventData( status, @@ -4481,7 +4487,7 @@ public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompl /// Initializes a new instance of . /// Type of action of the operation. /// A new instance for mocking. - public static AppEventTypeDetail AppEventTypeDetail(AppAction action = default) + public static AppEventTypeDetail AppEventTypeDetail(AppAction? action = null) { return new AppEventTypeDetail(action, serializedAdditionalRawData: null); } @@ -4779,7 +4785,7 @@ public static WebAppServicePlanUpdatedEventData WebAppServicePlanUpdatedEventDat /// Type of action on the app service plan. /// Asynchronous operation status of the operation on the app service plan. /// A new instance for mocking. - public static AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(StampKind stampKind = default, AppServicePlanAction action = default, AsyncStatus status = default) + public static AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(StampKind? stampKind = null, AppServicePlanAction? action = null, AsyncStatus? status = null) { return new AppServicePlanEventTypeDetail(stampKind, action, status, serializedAdditionalRawData: null); } @@ -4835,7 +4841,7 @@ public static SubscriptionDeletedEventData SubscriptionDeletedEventData(string e return new SubscriptionDeletedEventData(eventSubscriptionId, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4843,13 +4849,13 @@ public static SubscriptionDeletedEventData SubscriptionDeletedEventData(string e /// /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// A new instance for mocking. - public static EventGridMQTTClientEventData EventGridMQTTClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) + /// A new instance for mocking. + public static EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { - return new EventGridMQTTClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); + return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4865,12 +4871,12 @@ public static EventGridMQTTClientEventData EventGridMQTTClientEventData(string c /// the 'createdOn' property. /// /// The key-value attributes that are assigned to the client resource. - /// A new instance for mocking. - public static EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, EventGridMQTTClientState state = default, DateTimeOffset createdOn = default, DateTimeOffset updatedOn = default, IReadOnlyDictionary attributes = null) + /// A new instance for mocking. + public static EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, EventGridMqttClientState? state = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, IReadOnlyDictionary attributes = null) { attributes ??= new Dictionary(); - return new EventGridMQTTClientCreatedOrUpdatedEventData( + return new EventGridMqttClientCreatedOrUpdatedEventData( clientAuthenticationName, clientName, namespaceName, @@ -4881,7 +4887,7 @@ public static EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCr attributes); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4889,13 +4895,13 @@ public static EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCr /// /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// A new instance for mocking. - public static EventGridMQTTClientDeletedEventData EventGridMQTTClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) + /// A new instance for mocking. + public static EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { - return new EventGridMQTTClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); + return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4912,10 +4918,10 @@ public static EventGridMQTTClientDeletedEventData EventGridMQTTClientDeletedEven /// disconnected events. Latest event will have a sequence number that is higher /// than the previous event. /// - /// A new instance for mocking. - public static EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null) + /// A new instance for mocking. + public static EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null) { - return new EventGridMQTTClientSessionConnectedEventData( + return new EventGridMqttClientSessionConnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -4924,7 +4930,7 @@ public static EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSe sequenceNumber); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4945,10 +4951,10 @@ public static EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSe /// Reason for the disconnection of the MQTT client's session. The value could be /// one of the values in the disconnection reasons table. /// - /// A new instance for mocking. - public static EventGridMQTTClientSessionDisconnectedEventData EventGridMQTTClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null, EventGridMQTTClientDisconnectionReason disconnectionReason = default) + /// A new instance for mocking. + public static EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null, EventGridMqttClientDisconnectionReason? disconnectionReason = null) { - return new EventGridMQTTClientSessionDisconnectedEventData( + return new EventGridMqttClientSessionDisconnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -4994,7 +5000,7 @@ public static ResourceNotificationsResourceUpdatedDetails ResourceNotificationsR /// Initializes a new instance of . /// Date and Time when resource was updated. /// A new instance for mocking. - public static ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(DateTimeOffset resourceEventTime = default) + public static ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime = null) { return new ResourceNotificationsOperationalDetails(resourceEventTime, serializedAdditionalRawData: null); } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs index 5138f5db152d..badf70077248 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs @@ -61,10 +61,16 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WritePropertyName("lastSequenceNumber"u8); writer.WriteNumberValue(LastSequenceNumber.Value); } - writer.WritePropertyName("firstEnqueueTime"u8); - writer.WriteStringValue(FirstEnqueueTime, "O"); - writer.WritePropertyName("lastEnqueueTime"u8); - writer.WriteStringValue(LastEnqueueTime, "O"); + if (Optional.IsDefined(FirstEnqueueTime)) + { + writer.WritePropertyName("firstEnqueueTime"u8); + writer.WriteStringValue(FirstEnqueueTime.Value, "O"); + } + if (Optional.IsDefined(LastEnqueueTime)) + { + writer.WritePropertyName("lastEnqueueTime"u8); + writer.WriteStringValue(LastEnqueueTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -110,8 +116,8 @@ internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFi int? eventCount = default; int? firstSequenceNumber = default; int? lastSequenceNumber = default; - DateTimeOffset firstEnqueueTime = default; - DateTimeOffset lastEnqueueTime = default; + DateTimeOffset? firstEnqueueTime = default; + DateTimeOffset? lastEnqueueTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -169,11 +175,19 @@ internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFi } if (property.NameEquals("firstEnqueueTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } firstEnqueueTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("lastEnqueueTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } lastEnqueueTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs index 0c670ab7b195..ff8f7f2a0e35 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs @@ -46,12 +46,8 @@ public partial class EventHubCaptureFileCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The first time from the queue. - /// The last time from the queue. - internal EventHubCaptureFileCreatedEventData(DateTimeOffset firstEnqueueTime, DateTimeOffset lastEnqueueTime) + internal EventHubCaptureFileCreatedEventData() { - FirstEnqueueTime = firstEnqueueTime; - LastEnqueueTime = lastEnqueueTime; } /// Initializes a new instance of . @@ -65,7 +61,7 @@ internal EventHubCaptureFileCreatedEventData(DateTimeOffset firstEnqueueTime, Da /// The first time from the queue. /// The last time from the queue. /// Keeps track of any properties unknown to the library. - internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, string partitionId, int? sizeInBytes, int? eventCount, int? firstSequenceNumber, int? lastSequenceNumber, DateTimeOffset firstEnqueueTime, DateTimeOffset lastEnqueueTime, IDictionary serializedAdditionalRawData) + internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, string partitionId, int? sizeInBytes, int? eventCount, int? firstSequenceNumber, int? lastSequenceNumber, DateTimeOffset? firstEnqueueTime, DateTimeOffset? lastEnqueueTime, IDictionary serializedAdditionalRawData) { Fileurl = fileurl; FileType = fileType; @@ -79,11 +75,6 @@ internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, st _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal EventHubCaptureFileCreatedEventData() - { - } - /// The path to the capture file. public string Fileurl { get; } /// The file type of the capture file. @@ -99,8 +90,8 @@ internal EventHubCaptureFileCreatedEventData() /// The last sequence number from the queue. public int? LastSequenceNumber { get; } /// The first time from the queue. - public DateTimeOffset FirstEnqueueTime { get; } + public DateTimeOffset? FirstEnqueueTime { get; } /// The last time from the queue. - public DateTimeOffset LastEnqueueTime { get; } + public DateTimeOffset? LastEnqueueTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs index a259170c9a1b..933ef2a240b5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - writer.WritePropertyName("resourceType"u8); - writer.WriteStringValue(FhirResourceType.ToString()); + if (Optional.IsDefined(FhirResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(FhirResourceType.Value.ToString()); + } if (Optional.IsDefined(FhirServiceHostName)) { writer.WritePropertyName("resourceFhirAccount"u8); @@ -81,7 +84,7 @@ internal static HealthcareFhirResourceCreatedEventData DeserializeHealthcareFhir { return null; } - HealthcareFhirResourceType resourceType = default; + HealthcareFhirResourceType? resourceType = default; string resourceFhirAccount = default; string resourceFhirId = default; long? resourceVersionId = default; @@ -91,6 +94,10 @@ internal static HealthcareFhirResourceCreatedEventData DeserializeHealthcareFhir { if (property.NameEquals("resourceType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceType = new HealthcareFhirResourceType(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs index ed48894c3e41..33b1ec472af0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs @@ -46,10 +46,8 @@ public partial class HealthcareFhirResourceCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of HL7 FHIR resource. - internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirResourceType) + internal HealthcareFhirResourceCreatedEventData() { - FhirResourceType = fhirResourceType; } /// Initializes a new instance of . @@ -58,7 +56,7 @@ internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirR /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// Keeps track of any properties unknown to the library. - internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) + internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; @@ -67,13 +65,8 @@ internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirR _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal HealthcareFhirResourceCreatedEventData() - { - } - /// Type of HL7 FHIR resource. - public HealthcareFhirResourceType FhirResourceType { get; } + public HealthcareFhirResourceType? FhirResourceType { get; } /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } /// Id of HL7 FHIR resource. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs index 66997fa36cde..17160ec565f1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - writer.WritePropertyName("resourceType"u8); - writer.WriteStringValue(FhirResourceType.ToString()); + if (Optional.IsDefined(FhirResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(FhirResourceType.Value.ToString()); + } if (Optional.IsDefined(FhirServiceHostName)) { writer.WritePropertyName("resourceFhirAccount"u8); @@ -81,7 +84,7 @@ internal static HealthcareFhirResourceDeletedEventData DeserializeHealthcareFhir { return null; } - HealthcareFhirResourceType resourceType = default; + HealthcareFhirResourceType? resourceType = default; string resourceFhirAccount = default; string resourceFhirId = default; long? resourceVersionId = default; @@ -91,6 +94,10 @@ internal static HealthcareFhirResourceDeletedEventData DeserializeHealthcareFhir { if (property.NameEquals("resourceType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceType = new HealthcareFhirResourceType(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs index 6e883f6f61e4..587830f92c2e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs @@ -46,10 +46,8 @@ public partial class HealthcareFhirResourceDeletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of HL7 FHIR resource. - internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirResourceType) + internal HealthcareFhirResourceDeletedEventData() { - FhirResourceType = fhirResourceType; } /// Initializes a new instance of . @@ -58,7 +56,7 @@ internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirR /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// Keeps track of any properties unknown to the library. - internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) + internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; @@ -67,13 +65,8 @@ internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirR _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal HealthcareFhirResourceDeletedEventData() - { - } - /// Type of HL7 FHIR resource. - public HealthcareFhirResourceType FhirResourceType { get; } + public HealthcareFhirResourceType? FhirResourceType { get; } /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } /// Id of HL7 FHIR resource. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs index b50fc3cf3653..52c18d67cdca 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - writer.WritePropertyName("resourceType"u8); - writer.WriteStringValue(FhirResourceType.ToString()); + if (Optional.IsDefined(FhirResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(FhirResourceType.Value.ToString()); + } if (Optional.IsDefined(FhirServiceHostName)) { writer.WritePropertyName("resourceFhirAccount"u8); @@ -81,7 +84,7 @@ internal static HealthcareFhirResourceUpdatedEventData DeserializeHealthcareFhir { return null; } - HealthcareFhirResourceType resourceType = default; + HealthcareFhirResourceType? resourceType = default; string resourceFhirAccount = default; string resourceFhirId = default; long? resourceVersionId = default; @@ -91,6 +94,10 @@ internal static HealthcareFhirResourceUpdatedEventData DeserializeHealthcareFhir { if (property.NameEquals("resourceType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceType = new HealthcareFhirResourceType(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs index 7133f01a47d2..d4d5a4ce3262 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs @@ -46,10 +46,8 @@ public partial class HealthcareFhirResourceUpdatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of HL7 FHIR resource. - internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirResourceType) + internal HealthcareFhirResourceUpdatedEventData() { - FhirResourceType = fhirResourceType; } /// Initializes a new instance of . @@ -58,7 +56,7 @@ internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirR /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// Keeps track of any properties unknown to the library. - internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) + internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; @@ -67,13 +65,8 @@ internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirR _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal HealthcareFhirResourceUpdatedEventData() - { - } - /// Type of HL7 FHIR resource. - public HealthcareFhirResourceType FhirResourceType { get; } + public HealthcareFhirResourceType? FhirResourceType { get; } /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } /// Id of HL7 FHIR resource. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs index dd461b059144..f8fefe54abe6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs @@ -56,10 +56,16 @@ void IJsonModel.Write(Utf8 writer.WritePropertyName("driftCoefficient"u8); writer.WriteNumberValue(DriftCoefficient.Value); } - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartTime, "O"); - writer.WritePropertyName("endTime"u8); - writer.WriteStringValue(EndTime, "O"); + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -104,8 +110,8 @@ internal static MachineLearningServicesDatasetDriftDetectedEventData Deserialize string baseDatasetId = default; string targetDatasetId = default; double? driftCoefficient = default; - DateTimeOffset startTime = default; - DateTimeOffset endTime = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -146,11 +152,19 @@ internal static MachineLearningServicesDatasetDriftDetectedEventData Deserialize } if (property.NameEquals("startTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } startTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("endTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } endTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs index 9027d0c37322..f86f30e006be 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs @@ -46,12 +46,8 @@ public partial class MachineLearningServicesDatasetDriftDetectedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The start time of the target dataset time series that resulted in drift detection. - /// The end time of the target dataset time series that resulted in drift detection. - internal MachineLearningServicesDatasetDriftDetectedEventData(DateTimeOffset startTime, DateTimeOffset endTime) + internal MachineLearningServicesDatasetDriftDetectedEventData() { - StartTime = startTime; - EndTime = endTime; } /// Initializes a new instance of . @@ -64,7 +60,7 @@ internal MachineLearningServicesDatasetDriftDetectedEventData(DateTimeOffset sta /// The start time of the target dataset time series that resulted in drift detection. /// The end time of the target dataset time series that resulted in drift detection. /// Keeps track of any properties unknown to the library. - internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId, string dataDriftName, string runId, string baseDatasetId, string targetDatasetId, double? driftCoefficient, DateTimeOffset startTime, DateTimeOffset endTime, IDictionary serializedAdditionalRawData) + internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId, string dataDriftName, string runId, string baseDatasetId, string targetDatasetId, double? driftCoefficient, DateTimeOffset? startTime, DateTimeOffset? endTime, IDictionary serializedAdditionalRawData) { DataDriftId = dataDriftId; DataDriftName = dataDriftName; @@ -77,11 +73,6 @@ internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal MachineLearningServicesDatasetDriftDetectedEventData() - { - } - /// The ID of the data drift monitor that triggered the event. public string DataDriftId { get; } /// The name of the data drift monitor that triggered the event. @@ -95,8 +86,8 @@ internal MachineLearningServicesDatasetDriftDetectedEventData() /// The coefficient result that triggered the event. public double? DriftCoefficient { get; } /// The start time of the target dataset time series that resulted in drift detection. - public DateTimeOffset StartTime { get; } + public DateTimeOffset? StartTime { get; } /// The end time of the target dataset time series that resulted in drift detection. - public DateTimeOffset EndTime { get; } + public DateTimeOffset? EndTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs index 9bd58376a5bb..9831c25118ed 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs @@ -33,10 +33,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -84,8 +90,8 @@ internal static MediaJobCanceledEventData DeserializeMediaJobCanceledEventData(J return null; } IReadOnlyList outputs = default; - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -103,11 +109,19 @@ internal static MediaJobCanceledEventData DeserializeMediaJobCanceledEventData(J } if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs index 953505804d20..bc8a9b88cb4f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs @@ -18,8 +18,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobCanceledEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// /// Gets the Job outputs. @@ -27,7 +25,7 @@ public partial class MediaJobCanceledEventData : MediaJobStateChangeEventData /// The available derived classes include . /// /// or is null. - internal MediaJobCanceledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IEnumerable outputs) : base(previousState, state, correlationData) + internal MediaJobCanceledEventData(IReadOnlyDictionary correlationData, IEnumerable outputs) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); Argument.AssertNotNull(outputs, nameof(outputs)); @@ -45,7 +43,7 @@ internal MediaJobCanceledEventData(MediaJobState previousState, MediaJobState st /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - internal MediaJobCanceledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobCanceledEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) { Outputs = outputs; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs index aa8a7fc6c7f8..ce8ee035df9b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -76,8 +82,8 @@ internal static MediaJobCancelingEventData DeserializeMediaJobCancelingEventData { return null; } - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,11 +91,19 @@ internal static MediaJobCancelingEventData DeserializeMediaJobCancelingEventData { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs index c1493f0f200e..252afc4da760 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs @@ -17,11 +17,9 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobCancelingEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// is null. - internal MediaJobCancelingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) : base(previousState, state, correlationData) + internal MediaJobCancelingEventData(IReadOnlyDictionary correlationData) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); } @@ -31,7 +29,7 @@ internal MediaJobCancelingEventData(MediaJobState previousState, MediaJobState s /// The new state of the Job. /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobCancelingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobCancelingEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs index 862507f4a435..bf8f0bec583a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs @@ -26,17 +26,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt } writer.WriteStartObject(); - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.ToString()); + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.Value.ToString()); + } if (Optional.IsDefined(Message)) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - writer.WritePropertyName("category"u8); - writer.WriteStringValue(Category.ToString()); - writer.WritePropertyName("retry"u8); - writer.WriteStringValue(Retry.ToString()); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (Optional.IsDefined(Retry)) + { + writer.WritePropertyName("retry"u8); + writer.WriteStringValue(Retry.Value.ToString()); + } writer.WritePropertyName("details"u8); writer.WriteStartArray(); foreach (var item in Details) @@ -82,10 +91,10 @@ internal static MediaJobError DeserializeMediaJobError(JsonElement element, Mode { return null; } - MediaJobErrorCode code = default; + MediaJobErrorCode? code = default; string message = default; - MediaJobErrorCategory category = default; - MediaJobRetry retry = default; + MediaJobErrorCategory? category = default; + MediaJobRetry? retry = default; IReadOnlyList details = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -93,6 +102,10 @@ internal static MediaJobError DeserializeMediaJobError(JsonElement element, Mode { if (property.NameEquals("code"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } code = new MediaJobErrorCode(property.Value.GetString()); continue; } @@ -103,11 +116,19 @@ internal static MediaJobError DeserializeMediaJobError(JsonElement element, Mode } if (property.NameEquals("category"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } category = new MediaJobErrorCategory(property.Value.GetString()); continue; } if (property.NameEquals("retry"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } retry = new MediaJobRetry(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs index 751ed7d395fe..a3d57837407f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs @@ -47,18 +47,12 @@ public partial class MediaJobError private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Error code describing the error. - /// Helps with categorization of errors. - /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. /// An array of details about specific errors that led to this reported error. /// is null. - internal MediaJobError(MediaJobErrorCode code, MediaJobErrorCategory category, MediaJobRetry retry, IEnumerable details) + internal MediaJobError(IEnumerable details) { Argument.AssertNotNull(details, nameof(details)); - Code = code; - Category = category; - Retry = retry; Details = details.ToList(); } @@ -69,7 +63,7 @@ internal MediaJobError(MediaJobErrorCode code, MediaJobErrorCategory category, M /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. /// An array of details about specific errors that led to this reported error. /// Keeps track of any properties unknown to the library. - internal MediaJobError(MediaJobErrorCode code, string message, MediaJobErrorCategory category, MediaJobRetry retry, IReadOnlyList details, IDictionary serializedAdditionalRawData) + internal MediaJobError(MediaJobErrorCode? code, string message, MediaJobErrorCategory? category, MediaJobRetry? retry, IReadOnlyList details, IDictionary serializedAdditionalRawData) { Code = code; Message = message; @@ -85,13 +79,13 @@ internal MediaJobError() } /// Error code describing the error. - public MediaJobErrorCode Code { get; } + public MediaJobErrorCode? Code { get; } /// A human-readable language-dependent representation of the error. public string Message { get; } /// Helps with categorization of errors. - public MediaJobErrorCategory Category { get; } + public MediaJobErrorCategory? Category { get; } /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. - public MediaJobRetry Retry { get; } + public MediaJobRetry? Retry { get; } /// An array of details about specific errors that led to this reported error. public IReadOnlyList Details { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs index 09a9e6d8144e..f42f7d1768f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs @@ -33,10 +33,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -84,8 +90,8 @@ internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(Jso return null; } IReadOnlyList outputs = default; - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -103,11 +109,19 @@ internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(Jso } if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs index 0c76f70e4bc5..339ba9bdc11c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs @@ -18,8 +18,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobErroredEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// /// Gets the Job outputs. @@ -27,7 +25,7 @@ public partial class MediaJobErroredEventData : MediaJobStateChangeEventData /// The available derived classes include . /// /// or is null. - internal MediaJobErroredEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IEnumerable outputs) : base(previousState, state, correlationData) + internal MediaJobErroredEventData(IReadOnlyDictionary correlationData, IEnumerable outputs) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); Argument.AssertNotNull(outputs, nameof(outputs)); @@ -45,7 +43,7 @@ internal MediaJobErroredEventData(MediaJobState previousState, MediaJobState sta /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - internal MediaJobErroredEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobErroredEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) { Outputs = outputs; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs index e7088261a09f..fb0b8bb594e3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs @@ -33,10 +33,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -84,8 +90,8 @@ internal static MediaJobFinishedEventData DeserializeMediaJobFinishedEventData(J return null; } IReadOnlyList outputs = default; - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -103,11 +109,19 @@ internal static MediaJobFinishedEventData DeserializeMediaJobFinishedEventData(J } if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs index 64a495eac9b8..595827f33d08 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs @@ -18,8 +18,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobFinishedEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// /// Gets the Job outputs. @@ -27,7 +25,7 @@ public partial class MediaJobFinishedEventData : MediaJobStateChangeEventData /// The available derived classes include . /// /// or is null. - internal MediaJobFinishedEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IEnumerable outputs) : base(previousState, state, correlationData) + internal MediaJobFinishedEventData(IReadOnlyDictionary correlationData, IEnumerable outputs) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); Argument.AssertNotNull(outputs, nameof(outputs)); @@ -45,7 +43,7 @@ internal MediaJobFinishedEventData(MediaJobState previousState, MediaJobState st /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - internal MediaJobFinishedEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobFinishedEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) { Outputs = outputs; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs index 86926e7dae11..2d3d4b7a0f23 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs @@ -37,8 +37,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp } writer.WritePropertyName("progress"u8); writer.WriteNumberValue(Progress); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs index 2a5881ab7ec5..4a124d196d51 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs @@ -52,15 +52,13 @@ public abstract partial class MediaJobOutput /// Initializes a new instance of . /// Gets the Job output error. /// Gets the Job output progress. - /// Gets the Job output state. /// is null. - protected MediaJobOutput(MediaJobError error, long progress, MediaJobState state) + protected MediaJobOutput(MediaJobError error, long progress) { Argument.AssertNotNull(error, nameof(error)); Error = error; Progress = progress; - State = state; } /// Initializes a new instance of . @@ -70,7 +68,7 @@ protected MediaJobOutput(MediaJobError error, long progress, MediaJobState state /// Gets the Job output progress. /// Gets the Job output state. /// Keeps track of any properties unknown to the library. - internal MediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState state, IDictionary serializedAdditionalRawData) + internal MediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState? state, IDictionary serializedAdditionalRawData) { OdataType = odataType; Error = error; @@ -94,6 +92,6 @@ internal MediaJobOutput() /// Gets the Job output progress. public long Progress { get; } /// Gets the Job output state. - public MediaJobState State { get; } + public MediaJobState? State { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs index 206565a09a99..56e3df8b8e16 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs @@ -42,8 +42,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WritePropertyName("progress"u8); writer.WriteNumberValue(Progress); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -87,7 +90,7 @@ internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement e MediaJobError error = default; string label = default; long progress = default; - MediaJobState state = default; + MediaJobState? state = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -119,6 +122,10 @@ internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement e } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs index b43e0081261b..52ebea802ff5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs @@ -16,9 +16,8 @@ public partial class MediaJobOutputAsset : MediaJobOutput /// Initializes a new instance of . /// Gets the Job output error. /// Gets the Job output progress. - /// Gets the Job output state. /// is null. - internal MediaJobOutputAsset(MediaJobError error, long progress, MediaJobState state) : base(error, progress, state) + internal MediaJobOutputAsset(MediaJobError error, long progress) : base(error, progress) { Argument.AssertNotNull(error, nameof(error)); @@ -33,7 +32,7 @@ internal MediaJobOutputAsset(MediaJobError error, long progress, MediaJobState s /// Gets the Job output state. /// Keeps track of any properties unknown to the library. /// Gets the Job output asset name. - internal MediaJobOutputAsset(string odataType, MediaJobError error, string label, long progress, MediaJobState state, IDictionary serializedAdditionalRawData, string assetName) : base(odataType, error, label, progress, state, serializedAdditionalRawData) + internal MediaJobOutputAsset(string odataType, MediaJobError error, string label, long progress, MediaJobState? state, IDictionary serializedAdditionalRawData, string assetName) : base(odataType, error, label, progress, state, serializedAdditionalRawData) { AssetName = assetName; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs index 64fa1df43688..9e852ee5bd3f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputCanceledEventData DeserializeMediaJobOutputCancele { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputCanceledEventData DeserializeMediaJobOutputCancele { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs index 55ec62b58492..9557aebd3544 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputCanceledEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputCanceledEventData : MediaJobOutputStateChange /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputCanceledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputCanceledEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputCanceledEventData(MediaJobState previousState, MediaJobOu /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputCanceledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputCanceledEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs index 1ea15a57398c..9fbe333d3000 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputCancelingEventData DeserializeMediaJobOutputCancel { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputCancelingEventData DeserializeMediaJobOutputCancel { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs index 30e7d163aaa6..b8d656cd4e98 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputCancelingEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputCancelingEventData : MediaJobOutputStateChang /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputCancelingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputCancelingEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputCancelingEventData(MediaJobState previousState, MediaJobO /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputCancelingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputCancelingEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs index 68d9e444422a..f29c1646a4b7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputErroredEventData DeserializeMediaJobOutputErroredE { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputErroredEventData DeserializeMediaJobOutputErroredE { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs index 22535aa75e81..9bd7bb2d0602 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputErroredEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputErroredEventData : MediaJobOutputStateChangeE /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputErroredEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputErroredEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputErroredEventData(MediaJobState previousState, MediaJobOut /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputErroredEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputErroredEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs index 3c41ec294d61..716c50d82ef1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishe { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishe { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs index 701290e6f1cf..7d33358fcf91 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputFinishedEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputFinishedEventData : MediaJobOutputStateChange /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputFinishedEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputFinishedEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputFinishedEventData(MediaJobState previousState, MediaJobOu /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputFinishedEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputFinishedEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs index c6b058be3140..faf6cd2745db 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputProcessingEventData DeserializeMediaJobOutputProce { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputProcessingEventData DeserializeMediaJobOutputProce { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs index 1d4c4de32283..2c0589312b25 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputProcessingEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputProcessingEventData : MediaJobOutputStateChan /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputProcessingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputProcessingEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputProcessingEventData(MediaJobState previousState, MediaJob /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputProcessingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputProcessingEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs index c0b0e6dbe44d..53ff7003c3dd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputScheduledEventData DeserializeMediaJobOutputSchedu { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputScheduledEventData DeserializeMediaJobOutputSchedu { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs index a11011667492..ec55af9cc5bc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputScheduledEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputScheduledEventData : MediaJobOutputStateChang /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputScheduledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputScheduledEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputScheduledEventData(MediaJobState previousState, MediaJobO /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputScheduledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputScheduledEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs index 856367ac3289..c9fdcf43a067 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputStateChangeEventData DeserializeMediaJobOutputStat { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputStateChangeEventData DeserializeMediaJobOutputStat { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs index d647fa5feff2..76c801b2ce24 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs @@ -49,7 +49,6 @@ public partial class MediaJobOutputStateChangeEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -57,12 +56,11 @@ public partial class MediaJobOutputStateChangeEventData /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputStateChangeEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) + internal MediaJobOutputStateChangeEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); - PreviousState = previousState; Output = output; JobCorrelationData = jobCorrelationData; } @@ -76,7 +74,7 @@ internal MediaJobOutputStateChangeEventData(MediaJobState previousState, MediaJo /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputStateChangeEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) + internal MediaJobOutputStateChangeEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) { PreviousState = previousState; Output = output; @@ -90,7 +88,7 @@ internal MediaJobOutputStateChangeEventData() } /// The previous state of the Job. - public MediaJobState PreviousState { get; } + public MediaJobState? PreviousState { get; } /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs index c3f5eb88e049..8761f70ddbe0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -76,8 +82,8 @@ internal static MediaJobProcessingEventData DeserializeMediaJobProcessingEventDa { return null; } - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,11 +91,19 @@ internal static MediaJobProcessingEventData DeserializeMediaJobProcessingEventDa { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs index 1298b135d442..b2dc61de7f29 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs @@ -17,11 +17,9 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobProcessingEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// is null. - internal MediaJobProcessingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) : base(previousState, state, correlationData) + internal MediaJobProcessingEventData(IReadOnlyDictionary correlationData) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); } @@ -31,7 +29,7 @@ internal MediaJobProcessingEventData(MediaJobState previousState, MediaJobState /// The new state of the Job. /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobProcessingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobProcessingEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs index 0c3a84cefb6d..cb77a5dda9f7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -76,8 +82,8 @@ internal static MediaJobScheduledEventData DeserializeMediaJobScheduledEventData { return null; } - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,11 +91,19 @@ internal static MediaJobScheduledEventData DeserializeMediaJobScheduledEventData { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs index f7f96abda48f..2df6fd8637c0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs @@ -17,11 +17,9 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobScheduledEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// is null. - internal MediaJobScheduledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) : base(previousState, state, correlationData) + internal MediaJobScheduledEventData(IReadOnlyDictionary correlationData) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); } @@ -31,7 +29,7 @@ internal MediaJobScheduledEventData(MediaJobState previousState, MediaJobState s /// The new state of the Job. /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobScheduledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobScheduledEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs index e13aa874ba83..469d93d70d6e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -76,8 +82,8 @@ internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEvent { return null; } - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,11 +91,19 @@ internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEvent { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs index ce4898df35b8..33b7707cfa81 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs @@ -49,16 +49,12 @@ public partial class MediaJobStateChangeEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// is null. - internal MediaJobStateChangeEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) + internal MediaJobStateChangeEventData(IReadOnlyDictionary correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); - PreviousState = previousState; - State = state; CorrelationData = correlationData; } @@ -67,7 +63,7 @@ internal MediaJobStateChangeEventData(MediaJobState previousState, MediaJobState /// The new state of the Job. /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobStateChangeEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) + internal MediaJobStateChangeEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) { PreviousState = previousState; State = state; @@ -81,9 +77,9 @@ internal MediaJobStateChangeEventData() } /// The previous state of the Job. - public MediaJobState PreviousState { get; } + public MediaJobState? PreviousState { get; } /// The new state of the Job. - public MediaJobState State { get; } + public MediaJobState? State { get; } /// Gets the Job correlation data. public IReadOnlyDictionary CorrelationData { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs index fc2dd3001525..38758c2ee828 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs @@ -28,8 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteStartObject(); writer.WritePropertyName("appId"u8); writer.WriteStringValue(AppId); - writer.WritePropertyName("cloud"u8); - writer.WriteStringValue(Cloud.ToString()); + if (Optional.IsDefined(Cloud)) + { + writer.WritePropertyName("cloud"u8); + writer.WriteStringValue(Cloud.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -69,7 +72,7 @@ internal static MicrosoftTeamsAppIdentifierModel DeserializeMicrosoftTeamsAppIde return null; } string appId = default; - CommunicationCloudEnvironmentModel cloud = default; + CommunicationCloudEnvironmentModel? cloud = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -81,6 +84,10 @@ internal static MicrosoftTeamsAppIdentifierModel DeserializeMicrosoftTeamsAppIde } if (property.NameEquals("cloud"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } cloud = new CommunicationCloudEnvironmentModel(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs index 41e1a566a23f..d53a1651e7ce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs @@ -47,21 +47,19 @@ public partial class MicrosoftTeamsAppIdentifierModel /// Initializes a new instance of . /// The Id of the Microsoft Teams application. - /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. /// is null. - internal MicrosoftTeamsAppIdentifierModel(string appId, CommunicationCloudEnvironmentModel cloud) + internal MicrosoftTeamsAppIdentifierModel(string appId) { Argument.AssertNotNull(appId, nameof(appId)); AppId = appId; - Cloud = cloud; } /// Initializes a new instance of . /// The Id of the Microsoft Teams application. /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. /// Keeps track of any properties unknown to the library. - internal MicrosoftTeamsAppIdentifierModel(string appId, CommunicationCloudEnvironmentModel cloud, IDictionary serializedAdditionalRawData) + internal MicrosoftTeamsAppIdentifierModel(string appId, CommunicationCloudEnvironmentModel? cloud, IDictionary serializedAdditionalRawData) { AppId = appId; Cloud = cloud; @@ -76,6 +74,6 @@ internal MicrosoftTeamsAppIdentifierModel() /// The Id of the Microsoft Teams application. public string AppId { get; } /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. - public CommunicationCloudEnvironmentModel Cloud { get; } + public CommunicationCloudEnvironmentModel? Cloud { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs index 8b21b231c15d..9b3efa1f5ae6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs @@ -33,8 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("isAnonymous"u8); writer.WriteBooleanValue(IsAnonymous.Value); } - writer.WritePropertyName("cloud"u8); - writer.WriteStringValue(Cloud.ToString()); + if (Optional.IsDefined(Cloud)) + { + writer.WritePropertyName("cloud"u8); + writer.WriteStringValue(Cloud.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -75,7 +78,7 @@ internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserI } string userId = default; bool? isAnonymous = default; - CommunicationCloudEnvironmentModel cloud = default; + CommunicationCloudEnvironmentModel? cloud = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,6 +99,10 @@ internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserI } if (property.NameEquals("cloud"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } cloud = new CommunicationCloudEnvironmentModel(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs index d8958e4d8035..1678ab0098cf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs @@ -47,14 +47,12 @@ public partial class MicrosoftTeamsUserIdentifierModel /// Initializes a new instance of . /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. - /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. /// is null. - internal MicrosoftTeamsUserIdentifierModel(string userId, CommunicationCloudEnvironmentModel cloud) + internal MicrosoftTeamsUserIdentifierModel(string userId) { Argument.AssertNotNull(userId, nameof(userId)); UserId = userId; - Cloud = cloud; } /// Initializes a new instance of . @@ -62,7 +60,7 @@ internal MicrosoftTeamsUserIdentifierModel(string userId, CommunicationCloudEnvi /// True if the Microsoft Teams user is anonymous. By default false if missing. /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. /// Keeps track of any properties unknown to the library. - internal MicrosoftTeamsUserIdentifierModel(string userId, bool? isAnonymous, CommunicationCloudEnvironmentModel cloud, IDictionary serializedAdditionalRawData) + internal MicrosoftTeamsUserIdentifierModel(string userId, bool? isAnonymous, CommunicationCloudEnvironmentModel? cloud, IDictionary serializedAdditionalRawData) { UserId = userId; IsAnonymous = isAnonymous; @@ -80,6 +78,6 @@ internal MicrosoftTeamsUserIdentifierModel() /// True if the Microsoft Teams user is anonymous. By default false if missing. public bool? IsAnonymous { get; } /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. - public CommunicationCloudEnvironmentModel Cloud { get; } + public CommunicationCloudEnvironmentModel? Cloud { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs index 3539e8cedfe1..613f1feeb145 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(PolicyAssignmentId)) { writer.WritePropertyName("policyAssignmentId"u8); @@ -96,7 +99,7 @@ internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsig { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string policyAssignmentId = default; string policyDefinitionId = default; string policyDefinitionReferenceId = default; @@ -109,6 +112,10 @@ internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsig { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs index 3c38df1b64d7..a8f8d505974e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs @@ -46,10 +46,8 @@ public partial class PolicyInsightsPolicyStateChangedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp) + internal PolicyInsightsPolicyStateChangedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -61,7 +59,7 @@ internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp) /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// Keeps track of any properties unknown to the library. - internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) + internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -73,13 +71,8 @@ internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp, str _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PolicyInsightsPolicyStateChangedEventData() - { - } - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } /// The resource ID of the policy definition. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs index 48370340ade1..c51e319aa8d9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(PolicyAssignmentId)) { writer.WritePropertyName("policyAssignmentId"u8); @@ -96,7 +99,7 @@ internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsig { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string policyAssignmentId = default; string policyDefinitionId = default; string policyDefinitionReferenceId = default; @@ -109,6 +112,10 @@ internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsig { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs index deb18f455881..44791f5f3ca6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs @@ -46,10 +46,8 @@ public partial class PolicyInsightsPolicyStateCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp) + internal PolicyInsightsPolicyStateCreatedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -61,7 +59,7 @@ internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp) /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// Keeps track of any properties unknown to the library. - internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) + internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -73,13 +71,8 @@ internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp, str _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PolicyInsightsPolicyStateCreatedEventData() - { - } - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } /// The resource ID of the policy definition. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs index 58921be05ccf..eecbf20cbeb5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(PolicyAssignmentId)) { writer.WritePropertyName("policyAssignmentId"u8); @@ -96,7 +99,7 @@ internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsig { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string policyAssignmentId = default; string policyDefinitionId = default; string policyDefinitionReferenceId = default; @@ -109,6 +112,10 @@ internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsig { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs index 412c1ba32b64..3a92458d4c13 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs @@ -46,10 +46,8 @@ public partial class PolicyInsightsPolicyStateDeletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp) + internal PolicyInsightsPolicyStateDeletedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -61,7 +59,7 @@ internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp) /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// Keeps track of any properties unknown to the library. - internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) + internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -73,13 +71,8 @@ internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp, str _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PolicyInsightsPolicyStateDeletedEventData() - { - } - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } /// The resource ID of the policy definition. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs similarity index 72% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs index f3c4f99cb3da..fd70df1bee84 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class RedisImportRDBCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisExportRdbCompletedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -56,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteEndObject(); } - RedisImportRDBCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RedisExportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedisImportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement, options); } - internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static RedisExportRdbCompletedEventData DeserializeRedisExportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,7 +79,7 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -104,46 +111,46 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple } } serializedAdditionalRawData = rawDataDictionary; - return new RedisImportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisExportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support writing '{options.Format}' format."); } } - RedisImportRDBCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RedisExportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedisImportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static RedisImportRDBCompletedEventData FromResponse(Response response) + internal static RedisExportRdbCompletedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeRedisImportRDBCompletedEventData(document.RootElement); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs similarity index 78% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs index 4d02e07eeb4c..f689ff3f1242 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs @@ -11,7 +11,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event. - public partial class RedisExportRDBCompletedEventData + public partial class RedisExportRdbCompletedEventData { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,17 @@ public partial class RedisExportRDBCompletedEventData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisExportRDBCompletedEventData(DateTimeOffset timestamp) + /// Initializes a new instance of . + internal RedisExportRdbCompletedEventData() { - Timestamp = timestamp; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. /// Keeps track of any properties unknown to the library. - internal RedisExportRDBCompletedEventData(DateTimeOffset timestamp, string name, string status, IDictionary serializedAdditionalRawData) + internal RedisExportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisExportRDBCompletedEventData(DateTimeOffset timestamp, string name, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisExportRDBCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs similarity index 72% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs index b2243abe55f5..00554d2343fc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class RedisExportRDBCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisImportRdbCompletedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -56,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteEndObject(); } - RedisExportRDBCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RedisImportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedisExportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement, options); } - internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static RedisImportRdbCompletedEventData DeserializeRedisImportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,7 +79,7 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -104,46 +111,46 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple } } serializedAdditionalRawData = rawDataDictionary; - return new RedisExportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisImportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support writing '{options.Format}' format."); } } - RedisExportRDBCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RedisImportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedisExportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static RedisExportRDBCompletedEventData FromResponse(Response response) + internal static RedisImportRdbCompletedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeRedisExportRDBCompletedEventData(document.RootElement); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs similarity index 78% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs index 58ca83a77ce3..7381f6f760ab 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs @@ -11,7 +11,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event. - public partial class RedisImportRDBCompletedEventData + public partial class RedisImportRdbCompletedEventData { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,17 @@ public partial class RedisImportRDBCompletedEventData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisImportRDBCompletedEventData(DateTimeOffset timestamp) + /// Initializes a new instance of . + internal RedisImportRdbCompletedEventData() { - Timestamp = timestamp; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. /// Keeps track of any properties unknown to the library. - internal RedisImportRDBCompletedEventData(DateTimeOffset timestamp, string name, string status, IDictionary serializedAdditionalRawData) + internal RedisImportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisImportRDBCompletedEventData(DateTimeOffset timestamp, string name, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisImportRDBCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs index e7bba1d4def5..039cdd1ab010 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -76,7 +79,7 @@ internal static RedisPatchingCompletedEventData DeserializeRedisPatchingComplete { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static RedisPatchingCompletedEventData DeserializeRedisPatchingComplete { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs index 0497287ee8e2..3cc0aee40d81 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs @@ -46,10 +46,8 @@ public partial class RedisPatchingCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisPatchingCompletedEventData(DateTimeOffset timestamp) + internal RedisPatchingCompletedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -57,7 +55,7 @@ internal RedisPatchingCompletedEventData(DateTimeOffset timestamp) /// The name of this event. /// The status of this event. Failed or succeeded. /// Keeps track of any properties unknown to the library. - internal RedisPatchingCompletedEventData(DateTimeOffset timestamp, string name, string status, IDictionary serializedAdditionalRawData) + internal RedisPatchingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisPatchingCompletedEventData(DateTimeOffset timestamp, string name, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisPatchingCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs index 6513d5f6b531..73501bd4e56f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -76,7 +79,7 @@ internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedE { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedE { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs index 0d7b4896c816..ac341ec49072 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs @@ -46,10 +46,8 @@ public partial class RedisScalingCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisScalingCompletedEventData(DateTimeOffset timestamp) + internal RedisScalingCompletedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -57,7 +55,7 @@ internal RedisScalingCompletedEventData(DateTimeOffset timestamp) /// The name of this event. /// The status of this event. Failed or succeeded. /// Keeps track of any properties unknown to the library. - internal RedisScalingCompletedEventData(DateTimeOffset timestamp, string name, string status, IDictionary serializedAdditionalRawData) + internal RedisScalingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisScalingCompletedEventData(DateTimeOffset timestamp, string name, s _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisScalingCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs index c5a191210bcc..33f0c3f896f8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - writer.WritePropertyName("resourceEventTime"u8); - writer.WriteStringValue(ResourceEventTime, "O"); + if (Optional.IsDefined(ResourceEventTime)) + { + writer.WritePropertyName("resourceEventTime"u8); + writer.WriteStringValue(ResourceEventTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -66,13 +69,17 @@ internal static ResourceNotificationsOperationalDetails DeserializeResourceNotif { return null; } - DateTimeOffset resourceEventTime = default; + DateTimeOffset? resourceEventTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("resourceEventTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceEventTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs index a55f436fa035..d9354209fe26 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs @@ -46,27 +46,20 @@ public partial class ResourceNotificationsOperationalDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Date and Time when resource was updated. - internal ResourceNotificationsOperationalDetails(DateTimeOffset resourceEventTime) + internal ResourceNotificationsOperationalDetails() { - ResourceEventTime = resourceEventTime; } /// Initializes a new instance of . /// Date and Time when resource was updated. /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsOperationalDetails(DateTimeOffset resourceEventTime, IDictionary serializedAdditionalRawData) + internal ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime, IDictionary serializedAdditionalRawData) { ResourceEventTime = resourceEventTime; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsOperationalDetails() - { - } - /// Date and Time when resource was updated. - public DateTimeOffset ResourceEventTime { get; } + public DateTimeOffset? ResourceEventTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs index ea1c86e92527..d069576b3f1d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8Json } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(HubName)) { writer.WritePropertyName("hubName"u8); @@ -81,7 +84,7 @@ internal static SignalRServiceClientConnectionConnectedEventData DeserializeSign { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string hubName = default; string connectionId = default; string userId = default; @@ -91,6 +94,10 @@ internal static SignalRServiceClientConnectionConnectedEventData DeserializeSign { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs index dcb093dd889d..69adb05a2aa6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs @@ -46,10 +46,8 @@ public partial class SignalRServiceClientConnectionConnectedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timestamp) + internal SignalRServiceClientConnectionConnectedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -58,7 +56,7 @@ internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timesta /// The connection Id of connected client connection. /// The user Id of connected client connection. /// Keeps track of any properties unknown to the library. - internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timestamp, string hubName, string connectionId, string userId, IDictionary serializedAdditionalRawData) + internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; HubName = hubName; @@ -67,13 +65,8 @@ internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timesta _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SignalRServiceClientConnectionConnectedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The hub of connected client connection. public string HubName { get; } /// The connection Id of connected client connection. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs index 711be138fa62..2de3b5e4744f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8J } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(HubName)) { writer.WritePropertyName("hubName"u8); @@ -86,7 +89,7 @@ internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeS { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string hubName = default; string connectionId = default; string userId = default; @@ -97,6 +100,10 @@ internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeS { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs index 6a0f3883fc81..89f6d8099f73 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs @@ -46,10 +46,8 @@ public partial class SignalRServiceClientConnectionDisconnectedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset timestamp) + internal SignalRServiceClientConnectionDisconnectedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -59,7 +57,7 @@ internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset time /// The user Id of connected client connection. /// The message of error that cause the client connection disconnected. /// Keeps track of any properties unknown to the library. - internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset timestamp, string hubName, string connectionId, string userId, string errorMessage, IDictionary serializedAdditionalRawData) + internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, string errorMessage, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; HubName = hubName; @@ -69,13 +67,8 @@ internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset time _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SignalRServiceClientConnectionDisconnectedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The hub of connected client connection. public string HubName { get; } /// The connection Id of connected client connection. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs new file mode 100644 index 000000000000..b5072eac433a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// The access tier of the blob. + public readonly partial struct StorageBlobAccessTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageBlobAccessTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HotValue = "Hot"; + private const string CoolValue = "Cool"; + private const string ColdValue = "Cold"; + private const string ArchiveValue = "Archive"; + private const string DefaultValue = "Default"; + + /// The blob is in access tier Hot. + public static StorageBlobAccessTier Hot { get; } = new StorageBlobAccessTier(HotValue); + /// The blob is in access tier Cool. + public static StorageBlobAccessTier Cool { get; } = new StorageBlobAccessTier(CoolValue); + /// The blob is in access tier Cold. + public static StorageBlobAccessTier Cold { get; } = new StorageBlobAccessTier(ColdValue); + /// The blob is in access tier Archive. + public static StorageBlobAccessTier Archive { get; } = new StorageBlobAccessTier(ArchiveValue); + /// The blob is in access tier Default(Inferred). + public static StorageBlobAccessTier Default { get; } = new StorageBlobAccessTier(DefaultValue); + /// Determines if two values are the same. + public static bool operator ==(StorageBlobAccessTier left, StorageBlobAccessTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageBlobAccessTier left, StorageBlobAccessTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StorageBlobAccessTier(string value) => new StorageBlobAccessTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StorageBlobAccessTier other && Equals(other); + /// + public bool Equals(StorageBlobAccessTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs index f1f9c1763628..d828cafd1d34 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs @@ -66,6 +66,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("blobType"u8); writer.WriteStringValue(BlobType); } + writer.WritePropertyName("accessTier"u8); + writer.WriteStringValue(AccessTier.ToString()); if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); @@ -147,6 +149,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa long? contentLength = default; long? contentOffset = default; string blobType = default; + StorageBlobAccessTier accessTier = default; string url = default; string sequencer = default; string identity = default; @@ -203,6 +206,11 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -250,6 +258,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs index a1799eea345a..5b97c6b1bddc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs @@ -46,12 +46,14 @@ public partial class StorageBlobCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . + /// The current tier of the blob. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// is null. - internal StorageBlobCreatedEventData(IReadOnlyDictionary storageDiagnostics) + internal StorageBlobCreatedEventData(StorageBlobAccessTier accessTier, IReadOnlyDictionary storageDiagnostics) { Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); + AccessTier = accessTier; StorageDiagnostics = storageDiagnostics; } @@ -64,12 +66,13 @@ internal StorageBlobCreatedEventData(IReadOnlyDictionary sto /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// Keeps track of any properties unknown to the library. - internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) + internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, StorageBlobAccessTier accessTier, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) { Api = api; ClientRequestId = clientRequestId; @@ -79,6 +82,7 @@ internal StorageBlobCreatedEventData(string api, string clientRequestId, string ContentLength = contentLength; ContentOffset = contentOffset; BlobType = blobType; + AccessTier = accessTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -107,6 +111,8 @@ internal StorageBlobCreatedEventData() public long? ContentOffset { get; } /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. + public StorageBlobAccessTier AccessTier { get; } /// The path to the blob. public string Url { get; } /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs index a9115170710f..03c678a53fb9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWrit } writer.WriteStartObject(); - writer.WritePropertyName("scheduleDateTime"u8); - writer.WriteStringValue(ScheduleDateTime, "O"); + if (Optional.IsDefined(ScheduleDateTime)) + { + writer.WritePropertyName("scheduleDateTime"u8); + writer.WriteStringValue(ScheduleDateTime.Value, "O"); + } if (Optional.IsDefined(AccountName)) { writer.WritePropertyName("accountName"u8); @@ -96,7 +99,7 @@ internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageB { return null; } - DateTimeOffset scheduleDateTime = default; + DateTimeOffset? scheduleDateTime = default; string accountName = default; string ruleName = default; string policyRunStatus = default; @@ -109,6 +112,10 @@ internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageB { if (property.NameEquals("scheduleDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduleDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs index 97097e7a9b6f..a4eabe105daf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs @@ -46,10 +46,8 @@ public partial class StorageBlobInventoryPolicyCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which inventory policy was scheduled. - internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDateTime) + internal StorageBlobInventoryPolicyCompletedEventData() { - ScheduleDateTime = scheduleDateTime; } /// Initializes a new instance of . @@ -61,7 +59,7 @@ internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDat /// The policy run id for inventory run. /// The blob URL for manifest file for inventory run. /// Keeps track of any properties unknown to the library. - internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDateTime, string accountName, string ruleName, string policyRunStatus, string policyRunStatusMessage, string policyRunId, string manifestBlobUrl, IDictionary serializedAdditionalRawData) + internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDateTime, string accountName, string ruleName, string policyRunStatus, string policyRunStatusMessage, string policyRunId, string manifestBlobUrl, IDictionary serializedAdditionalRawData) { ScheduleDateTime = scheduleDateTime; AccountName = accountName; @@ -73,13 +71,8 @@ internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDat _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal StorageBlobInventoryPolicyCompletedEventData() - { - } - /// The time at which inventory policy was scheduled. - public DateTimeOffset ScheduleDateTime { get; } + public DateTimeOffset? ScheduleDateTime { get; } /// The account name for which inventory policy is registered. public string AccountName { get; } /// The rule name for inventory policy. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs index 596e8462a99b..8e0b0cba9a2f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs @@ -56,6 +56,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WritePropertyName("blobType"u8); writer.WriteStringValue(BlobType); } + writer.WritePropertyName("accessTier"u8); + writer.WriteStringValue(AccessTier.ToString()); + writer.WritePropertyName("previousTier"u8); + writer.WriteStringValue(PreviousTier.ToString()); if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); @@ -135,6 +139,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange string contentType = default; long? contentLength = default; string blobType = default; + StorageBlobAccessTier accessTier = default; + StorageBlobAccessTier previousTier = default; string url = default; string sequencer = default; string identity = default; @@ -177,6 +183,16 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("previousTier"u8)) + { + previousTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -222,6 +238,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs index e1f0f18db416..ae0660ee74c4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs @@ -46,12 +46,16 @@ public partial class StorageBlobTierChangedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . + /// The current tier of the blob. + /// The previous tier of the blob. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// is null. - internal StorageBlobTierChangedEventData(IReadOnlyDictionary storageDiagnostics) + internal StorageBlobTierChangedEventData(StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, IReadOnlyDictionary storageDiagnostics) { Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); + AccessTier = accessTier; + PreviousTier = previousTier; StorageDiagnostics = storageDiagnostics; } @@ -62,12 +66,14 @@ internal StorageBlobTierChangedEventData(IReadOnlyDictionary /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// Keeps track of any properties unknown to the library. - internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) + internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) { Api = api; ClientRequestId = clientRequestId; @@ -75,6 +81,8 @@ internal StorageBlobTierChangedEventData(string api, string clientRequestId, str ContentType = contentType; ContentLength = contentLength; BlobType = blobType; + AccessTier = accessTier; + PreviousTier = previousTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -99,6 +107,10 @@ internal StorageBlobTierChangedEventData() public long? ContentLength { get; } /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. + public StorageBlobAccessTier AccessTier { get; } + /// The previous tier of the blob. + public StorageBlobAccessTier PreviousTier { get; } /// The path to the blob. public string Url { get; } /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs index 0a0edd35a325..d4cc7951c00c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("completedDateTime"u8); - writer.WriteStringValue(CompletedOn, "O"); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(CompletedOn)) + { + writer.WritePropertyName("completedDateTime"u8); + writer.WriteStringValue(CompletedOn.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -80,8 +86,8 @@ internal static StorageTaskAssignmentCompletedEventData DeserializeStorageTaskAs { return null; } - StorageTaskAssignmentCompletedStatus status = default; - DateTimeOffset completedDateTime = default; + StorageTaskAssignmentCompletedStatus? status = default; + DateTimeOffset? completedDateTime = default; string taskExecutionId = default; string taskName = default; Uri summaryReportBlobUrl = default; @@ -91,11 +97,19 @@ internal static StorageTaskAssignmentCompletedEventData DeserializeStorageTaskAs { if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new StorageTaskAssignmentCompletedStatus(property.Value.GetString()); continue; } if (property.NameEquals("completedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } completedDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs index acf2da3e348f..91f49d744b3d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs @@ -46,16 +46,12 @@ public partial class StorageTaskAssignmentCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The status for a storage task. - /// The time at which a storage task was completed. /// The summary report blob url for a storage task. /// is null. - internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus status, DateTimeOffset completedOn, Uri summaryReportBlobUri) + internal StorageTaskAssignmentCompletedEventData(Uri summaryReportBlobUri) { Argument.AssertNotNull(summaryReportBlobUri, nameof(summaryReportBlobUri)); - Status = status; - CompletedOn = completedOn; SummaryReportBlobUri = summaryReportBlobUri; } @@ -66,7 +62,7 @@ internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedS /// The task name for a storage task. /// The summary report blob url for a storage task. /// Keeps track of any properties unknown to the library. - internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus status, DateTimeOffset completedOn, string taskExecutionId, string taskName, Uri summaryReportBlobUri, IDictionary serializedAdditionalRawData) + internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status, DateTimeOffset? completedOn, string taskExecutionId, string taskName, Uri summaryReportBlobUri, IDictionary serializedAdditionalRawData) { Status = status; CompletedOn = completedOn; @@ -82,9 +78,9 @@ internal StorageTaskAssignmentCompletedEventData() } /// The status for a storage task. - public StorageTaskAssignmentCompletedStatus Status { get; } + public StorageTaskAssignmentCompletedStatus? Status { get; } /// The time at which a storage task was completed. - public DateTimeOffset CompletedOn { get; } + public DateTimeOffset? CompletedOn { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } /// The task name for a storage task. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs index 2c7f37b81b43..32854032bd7f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteStartObject(); - writer.WritePropertyName("queuedDateTime"u8); - writer.WriteStringValue(QueuedOn, "O"); + if (Optional.IsDefined(QueuedOn)) + { + writer.WritePropertyName("queuedDateTime"u8); + writer.WriteStringValue(QueuedOn.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -71,7 +74,7 @@ internal static StorageTaskAssignmentQueuedEventData DeserializeStorageTaskAssig { return null; } - DateTimeOffset queuedDateTime = default; + DateTimeOffset? queuedDateTime = default; string taskExecutionId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -79,6 +82,10 @@ internal static StorageTaskAssignmentQueuedEventData DeserializeStorageTaskAssig { if (property.NameEquals("queuedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } queuedDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs index 629cae0b0418..c03472230485 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs @@ -46,30 +46,23 @@ public partial class StorageTaskAssignmentQueuedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which a storage task was queued. - internal StorageTaskAssignmentQueuedEventData(DateTimeOffset queuedOn) + internal StorageTaskAssignmentQueuedEventData() { - QueuedOn = queuedOn; } /// Initializes a new instance of . /// The time at which a storage task was queued. /// The execution id for a storage task. /// Keeps track of any properties unknown to the library. - internal StorageTaskAssignmentQueuedEventData(DateTimeOffset queuedOn, string taskExecutionId, IDictionary serializedAdditionalRawData) + internal StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn, string taskExecutionId, IDictionary serializedAdditionalRawData) { QueuedOn = queuedOn; TaskExecutionId = taskExecutionId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal StorageTaskAssignmentQueuedEventData() - { - } - /// The time at which a storage task was queued. - public DateTimeOffset QueuedOn { get; } + public DateTimeOffset? QueuedOn { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs index 1dec95ca7cc9..62c9f0d7e9a8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("completedDateTime"u8); - writer.WriteStringValue(CompletedDateTime, "O"); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(CompletedDateTime)) + { + writer.WritePropertyName("completedDateTime"u8); + writer.WriteStringValue(CompletedDateTime.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -80,8 +86,8 @@ internal static StorageTaskCompletedEventData DeserializeStorageTaskCompletedEve { return null; } - StorageTaskCompletedStatus status = default; - DateTimeOffset completedDateTime = default; + StorageTaskCompletedStatus? status = default; + DateTimeOffset? completedDateTime = default; string taskExecutionId = default; string taskName = default; Uri summaryReportBlobUrl = default; @@ -91,11 +97,19 @@ internal static StorageTaskCompletedEventData DeserializeStorageTaskCompletedEve { if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new StorageTaskCompletedStatus(property.Value.GetString()); continue; } if (property.NameEquals("completedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } completedDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs index a7e3b6af287d..068d575deae8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs @@ -46,16 +46,12 @@ public partial class StorageTaskCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The status for a storage task. - /// The time at which a storage task was completed. /// The summary report blob url for a storage task. /// is null. - internal StorageTaskCompletedEventData(StorageTaskCompletedStatus status, DateTimeOffset completedDateTime, Uri summaryReportBlobUrl) + internal StorageTaskCompletedEventData(Uri summaryReportBlobUrl) { Argument.AssertNotNull(summaryReportBlobUrl, nameof(summaryReportBlobUrl)); - Status = status; - CompletedDateTime = completedDateTime; SummaryReportBlobUrl = summaryReportBlobUrl; } @@ -66,7 +62,7 @@ internal StorageTaskCompletedEventData(StorageTaskCompletedStatus status, DateTi /// The task name for a storage task. /// The summary report blob url for a storage task. /// Keeps track of any properties unknown to the library. - internal StorageTaskCompletedEventData(StorageTaskCompletedStatus status, DateTimeOffset completedDateTime, string taskExecutionId, string taskName, Uri summaryReportBlobUrl, IDictionary serializedAdditionalRawData) + internal StorageTaskCompletedEventData(StorageTaskCompletedStatus? status, DateTimeOffset? completedDateTime, string taskExecutionId, string taskName, Uri summaryReportBlobUrl, IDictionary serializedAdditionalRawData) { Status = status; CompletedDateTime = completedDateTime; @@ -82,9 +78,9 @@ internal StorageTaskCompletedEventData() } /// The status for a storage task. - public StorageTaskCompletedStatus Status { get; } + public StorageTaskCompletedStatus? Status { get; } /// The time at which a storage task was completed. - public DateTimeOffset CompletedDateTime { get; } + public DateTimeOffset? CompletedDateTime { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } /// The task name for a storage task. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs index 9fe80d23b2b2..88f1c24ab5ee 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteStartObject(); - writer.WritePropertyName("queuedDateTime"u8); - writer.WriteStringValue(QueuedDateTime, "O"); + if (Optional.IsDefined(QueuedDateTime)) + { + writer.WritePropertyName("queuedDateTime"u8); + writer.WriteStringValue(QueuedDateTime.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -71,7 +74,7 @@ internal static StorageTaskQueuedEventData DeserializeStorageTaskQueuedEventData { return null; } - DateTimeOffset queuedDateTime = default; + DateTimeOffset? queuedDateTime = default; string taskExecutionId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -79,6 +82,10 @@ internal static StorageTaskQueuedEventData DeserializeStorageTaskQueuedEventData { if (property.NameEquals("queuedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } queuedDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs index 0ad77410c7c3..79169b81a03e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs @@ -46,30 +46,23 @@ public partial class StorageTaskQueuedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which a storage task was queued. - internal StorageTaskQueuedEventData(DateTimeOffset queuedDateTime) + internal StorageTaskQueuedEventData() { - QueuedDateTime = queuedDateTime; } /// Initializes a new instance of . /// The time at which a storage task was queued. /// The execution id for a storage task. /// Keeps track of any properties unknown to the library. - internal StorageTaskQueuedEventData(DateTimeOffset queuedDateTime, string taskExecutionId, IDictionary serializedAdditionalRawData) + internal StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime, string taskExecutionId, IDictionary serializedAdditionalRawData) { QueuedDateTime = queuedDateTime; TaskExecutionId = taskExecutionId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal StorageTaskQueuedEventData() - { - } - /// The time at which a storage task was queued. - public DateTimeOffset QueuedDateTime { get; } + public DateTimeOffset? QueuedDateTime { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs index 0d99553ffa77..17e37e2f9d4b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs @@ -13,13 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Client options for SystemEventsClient. internal partial class SystemEventsClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_01_01; + private const ServiceVersion LatestVersion = ServiceVersion.V2018_01_01; /// The version of the service to use. internal enum ServiceVersion { - /// Service version "2024-01-01". - V2024_01_01 = 1, + /// Service version "2018-01-01". + V2018_01_01 = 1, } internal string Version { get; } @@ -29,7 +29,7 @@ public SystemEventsClientOptions(ServiceVersion version = LatestVersion) { Version = version switch { - ServiceVersion.V2024_01_01 => "2024-01-01", + ServiceVersion.V2018_01_01 => "2018-01-01", _ => throw new NotSupportedException() }; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs index 01e4ff8b3e1c..9c616f4f8516 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs @@ -37,8 +37,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp } writer.WritePropertyName("progress"u8); writer.WriteNumberValue(Progress); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -81,7 +84,7 @@ internal static UnknownMediaJobOutput DeserializeUnknownMediaJobOutput(JsonEleme MediaJobError error = default; string label = default; long progress = default; - MediaJobState state = default; + MediaJobState? state = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -108,6 +111,10 @@ internal static UnknownMediaJobOutput DeserializeUnknownMediaJobOutput(JsonEleme } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs index 0bfb2f76e943..1e59a62941b6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs @@ -20,7 +20,7 @@ internal partial class UnknownMediaJobOutput : MediaJobOutput /// Gets the Job output progress. /// Gets the Job output state. /// Keeps track of any properties unknown to the library. - internal UnknownMediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState state, IDictionary serializedAdditionalRawData) : base(odataType, error, label, progress, state, serializedAdditionalRawData) + internal UnknownMediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState? state, IDictionary serializedAdditionalRawData) : base(odataType, error, label, progress, state, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml index e59d0681c201..b268d5656bf4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml @@ -1,3 +1,4 @@ -repo: Azure/azure-rest-api-specs -directory: "specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents" -commit: 9f024124361561030653abd1e8ec6d5ad1080c1a +directory: specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/Azure.Messaging.EventGrid.Namespaces.sln b/sdk/eventgrid/Azure.Messaging.EventGridV2/Azure.Messaging.EventGrid.Namespaces.sln new file mode 100644 index 000000000000..391d7e850673 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/Azure.Messaging.EventGrid.Namespaces.sln @@ -0,0 +1,54 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Messaging.EventGrid.Namespaces", "src\Azure.Messaging.EventGrid.Namespaces.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGridV2/CHANGELOG.md new file mode 100644 index 000000000000..13dd08af78ab --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/Directory.Build.props b/sdk/eventgrid/Azure.Messaging.EventGridV2/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/README.md b/sdk/eventgrid/Azure.Messaging.EventGridV2/README.md new file mode 100644 index 000000000000..4989c61c2afb --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/README.md @@ -0,0 +1,107 @@ +# Azure.Messaging.EventGrid.Namespaces client library for .NET + +Azure.Messaging.EventGrid.Namespaces is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Messaging.EventGrid.Namespaces --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateClientForSpecificApiVersion +Uri endpoint = new Uri(""); +DefaultAzureCredential credential = new DefaultAzureCredential(); +ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.) +var client = new Client(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.png) diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs new file mode 100644 index 000000000000..c928aa91bd4f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs @@ -0,0 +1,212 @@ +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class AcknowledgeResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AcknowledgeResult() { } + public System.Collections.Generic.IReadOnlyList FailedLockTokens { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SucceededLockTokens { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.AcknowledgeResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.AcknowledgeResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BrokerProperties() { } + public int DeliveryCount { get { throw null; } } + public string LockToken { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.BrokerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.BrokerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class EventGridNamespacesModelFactory + { + public static Azure.Messaging.EventGrid.Namespaces.AcknowledgeResult AcknowledgeResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.BrokerProperties BrokerProperties(string lockToken = null, int deliveryCount = 0) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.FailedLockToken FailedLockToken(string lockToken = null, Azure.ResponseError error = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.ReceiveDetails ReceiveDetails(Azure.Messaging.EventGrid.Namespaces.BrokerProperties brokerProperties = null, Azure.Messaging.CloudEvent @event = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.ReceiveResult ReceiveResult(System.Collections.Generic.IEnumerable details = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.RejectResult RejectResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseResult ReleaseResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.RenewLocksResult RenewLocksResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + } + public partial class EventGridReceiverClient + { + protected EventGridReceiverClient() { } + public EventGridReceiverClient(System.Uri endpoint, string topicName, string subscriptionName, Azure.AzureKeyCredential credential) { } + public EventGridReceiverClient(System.Uri endpoint, string topicName, string subscriptionName, Azure.AzureKeyCredential credential, Azure.Messaging.EventGrid.Namespaces.EventGridReceiverClientOptions options) { } + public EventGridReceiverClient(System.Uri endpoint, string topicName, string subscriptionName, Azure.Core.TokenCredential credential) { } + public EventGridReceiverClient(System.Uri endpoint, string topicName, string subscriptionName, Azure.Core.TokenCredential credential, Azure.Messaging.EventGrid.Namespaces.EventGridReceiverClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response Acknowledge(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response Acknowledge(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task AcknowledgeAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> AcknowledgeAsync(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response Receive(int? maxEvents, System.TimeSpan? maxWaitTime, Azure.RequestContext context) { throw null; } + public virtual Azure.Response Receive(int? maxEvents = default(int?), System.TimeSpan? maxWaitTime = default(System.TimeSpan?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task ReceiveAsync(int? maxEvents, System.TimeSpan? maxWaitTime, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> ReceiveAsync(int? maxEvents = default(int?), System.TimeSpan? maxWaitTime = default(System.TimeSpan?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response Reject(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response Reject(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task RejectAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> RejectAsync(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response Release(Azure.Core.RequestContent content, string releaseDelayInSeconds = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response Release(System.Collections.Generic.IEnumerable lockTokens, Azure.Messaging.EventGrid.Namespaces.ReleaseDelay? delay = default(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task ReleaseAsync(Azure.Core.RequestContent content, string releaseDelayInSeconds = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> ReleaseAsync(System.Collections.Generic.IEnumerable lockTokens, Azure.Messaging.EventGrid.Namespaces.ReleaseDelay? delay = default(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response RenewLocks(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response RenewLocks(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task RenewLocksAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> RenewLocksAsync(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EventGridReceiverClientOptions : Azure.Core.ClientOptions + { + public EventGridReceiverClientOptions(Azure.Messaging.EventGrid.Namespaces.EventGridReceiverClientOptions.ServiceVersion version = Azure.Messaging.EventGrid.Namespaces.EventGridReceiverClientOptions.ServiceVersion.V2024_06_01) { } + public enum ServiceVersion + { + V2023_11_01 = 1, + V2024_06_01 = 2, + } + } + public partial class EventGridSenderClient + { + protected EventGridSenderClient() { } + public EventGridSenderClient(System.Uri endpoint, string topicName, Azure.AzureKeyCredential credential) { } + public EventGridSenderClient(System.Uri endpoint, string topicName, Azure.AzureKeyCredential credential, Azure.Messaging.EventGrid.Namespaces.EventGridSenderClientOptions options) { } + public EventGridSenderClient(System.Uri endpoint, string topicName, Azure.Core.TokenCredential credential) { } + public EventGridSenderClient(System.Uri endpoint, string topicName, Azure.Core.TokenCredential credential, Azure.Messaging.EventGrid.Namespaces.EventGridSenderClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response Send(Azure.Messaging.CloudEvent cloudEvent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Send(System.Collections.Generic.IEnumerable cloudEvents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SendAsync(Azure.Messaging.CloudEvent cloudEvent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SendAsync(System.Collections.Generic.IEnumerable cloudEvents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response SendEvent(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task SendEventAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response SendEvents(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task SendEventsAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public partial class EventGridSenderClientOptions : Azure.Core.ClientOptions + { + public EventGridSenderClientOptions(Azure.Messaging.EventGrid.Namespaces.EventGridSenderClientOptions.ServiceVersion version = Azure.Messaging.EventGrid.Namespaces.EventGridSenderClientOptions.ServiceVersion.V2024_06_01) { } + public enum ServiceVersion + { + V2023_11_01 = 1, + V2024_06_01 = 2, + } + } + public partial class FailedLockToken : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailedLockToken() { } + public Azure.ResponseError Error { get { throw null; } } + public string LockToken { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.FailedLockToken System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.FailedLockToken System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReceiveDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReceiveDetails() { } + public Azure.Messaging.EventGrid.Namespaces.BrokerProperties BrokerProperties { get { throw null; } } + public Azure.Messaging.CloudEvent Event { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.ReceiveDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.ReceiveDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReceiveResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReceiveResult() { } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.ReceiveResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.ReceiveResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RejectResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RejectResult() { } + public System.Collections.Generic.IReadOnlyList FailedLockTokens { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SucceededLockTokens { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.RejectResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.RejectResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ReleaseDelay : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ReleaseDelay(string value) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay NoDelay { get { throw null; } } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay OneHour { get { throw null; } } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay OneMinute { get { throw null; } } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay TenMinutes { get { throw null; } } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay TenSeconds { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay left, Azure.Messaging.EventGrid.Namespaces.ReleaseDelay right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.Namespaces.ReleaseDelay (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay left, Azure.Messaging.EventGrid.Namespaces.ReleaseDelay right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ReleaseResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReleaseResult() { } + public System.Collections.Generic.IReadOnlyList FailedLockTokens { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SucceededLockTokens { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.ReleaseResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.ReleaseResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RenewLocksResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RenewLocksResult() { } + public System.Collections.Generic.IReadOnlyList FailedLockTokens { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SucceededLockTokens { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.RenewLocksResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.RenewLocksResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Microsoft.Extensions.Azure +{ + public static partial class EventGridNamespacesClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, System.Uri endpoint, string topicName, string subscriptionName) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, System.Uri endpoint, string topicName, string subscriptionName, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, System.Uri endpoint, string topicName) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, System.Uri endpoint, string topicName, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Azure.Messaging.EventGrid.Namespaces.csproj b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Azure.Messaging.EventGrid.Namespaces.csproj new file mode 100644 index 000000000000..63c432e943e1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Azure.Messaging.EventGrid.Namespaces.csproj @@ -0,0 +1,20 @@ + + + This is the Azure.Messaging.EventGrid.Namespaces client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.Messaging.EventGrid.Namespaces for Azure Data Plane + 1.0.0-beta.1 + Azure.Messaging.EventGrid.Namespaces + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.Serialization.cs similarity index 54% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.Serialization.cs index ee85b4cdba09..03769320022b 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/WindowsGmsaProfile.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.Serialization.cs @@ -11,36 +11,28 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Messaging.EventGrid.Namespaces { - public partial class WindowsGmsaProfile : IUtf8JsonSerializable, IJsonModel + internal partial class AcknowledgeRequest : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(WindowsGmsaProfile)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AcknowledgeRequest)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) + writer.WritePropertyName("lockTokens"u8); + writer.WriteStartArray(); + foreach (var item in LockTokens) { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(DnsServer)) - { - writer.WritePropertyName("dnsServer"u8); - writer.WriteStringValue(DnsServer); - } - if (Optional.IsDefined(RootDomainName)) - { - writer.WritePropertyName("rootDomainName"u8); - writer.WriteStringValue(RootDomainName); + writer.WriteStringValue(item); } + writer.WriteEndArray(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -59,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - WindowsGmsaProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AcknowledgeRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(WindowsGmsaProfile)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AcknowledgeRequest)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeWindowsGmsaProfile(document.RootElement, options); + return DeserializeAcknowledgeRequest(document.RootElement, options); } - internal static WindowsGmsaProfile DeserializeWindowsGmsaProfile(JsonElement element, ModelReaderWriterOptions options = null) + internal static AcknowledgeRequest DeserializeAcknowledgeRequest(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,30 +71,19 @@ internal static WindowsGmsaProfile DeserializeWindowsGmsaProfile(JsonElement ele { return null; } - bool? enabled = default; - string dnsServer = default; - string rootDomainName = default; + IReadOnlyList lockTokens = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("enabled"u8)) + if (property.NameEquals("lockTokens"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(item.GetString()); } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("dnsServer"u8)) - { - dnsServer = property.Value.GetString(); - continue; - } - if (property.NameEquals("rootDomainName"u8)) - { - rootDomainName = property.Value.GetString(); + lockTokens = array; continue; } if (options.Format != "W") @@ -111,38 +92,54 @@ internal static WindowsGmsaProfile DeserializeWindowsGmsaProfile(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new WindowsGmsaProfile(enabled, dnsServer, rootDomainName, serializedAdditionalRawData); + return new AcknowledgeRequest(lockTokens, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(WindowsGmsaProfile)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AcknowledgeRequest)} does not support writing '{options.Format}' format."); } } - WindowsGmsaProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AcknowledgeRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeWindowsGmsaProfile(document.RootElement, options); + return DeserializeAcknowledgeRequest(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(WindowsGmsaProfile)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AcknowledgeRequest)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AcknowledgeRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAcknowledgeRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.cs similarity index 63% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.cs index 0dc33327c3b5..da487d167f8b 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// The AgentPoolUpgradeProfilePropertiesUpgradesItem. - public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem + /// The AcknowledgeRequest. + internal partial class AcknowledgeRequest { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +46,31 @@ public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal AgentPoolUpgradeProfilePropertiesUpgradesItem() + /// Initializes a new instance of . + /// Array of lock tokens. + /// is null. + internal AcknowledgeRequest(IEnumerable lockTokens) { + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + LockTokens = lockTokens.ToList(); } - /// Initializes a new instance of . - /// The Kubernetes version (major.minor.patch). - /// Whether the Kubernetes version is currently in preview. + /// Initializes a new instance of . + /// Array of lock tokens. /// Keeps track of any properties unknown to the library. - internal AgentPoolUpgradeProfilePropertiesUpgradesItem(string kubernetesVersion, bool? isPreview, IDictionary serializedAdditionalRawData) + internal AcknowledgeRequest(IReadOnlyList lockTokens, IDictionary serializedAdditionalRawData) { - KubernetesVersion = kubernetesVersion; - IsPreview = isPreview; + LockTokens = lockTokens; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The Kubernetes version (major.minor.patch). - public string KubernetesVersion { get; } - /// Whether the Kubernetes version is currently in preview. - public bool? IsPreview { get; } + /// Initializes a new instance of for deserialization. + internal AcknowledgeRequest() + { + } + + /// Array of lock tokens. + public IReadOnlyList LockTokens { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.Serialization.cs new file mode 100644 index 000000000000..deff988099d1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class AcknowledgeResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AcknowledgeResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("failedLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in FailedLockTokens) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("succeededLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in SucceededLockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AcknowledgeResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AcknowledgeResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcknowledgeResult(document.RootElement, options); + } + + internal static AcknowledgeResult DeserializeAcknowledgeResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList failedLockTokens = default; + IReadOnlyList succeededLockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failedLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailedLockToken.DeserializeFailedLockToken(item, options)); + } + failedLockTokens = array; + continue; + } + if (property.NameEquals("succeededLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + succeededLockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AcknowledgeResult(failedLockTokens, succeededLockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AcknowledgeResult)} does not support writing '{options.Format}' format."); + } + } + + AcknowledgeResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAcknowledgeResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AcknowledgeResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AcknowledgeResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAcknowledgeResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.cs new file mode 100644 index 000000000000..a30895c4a023 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The result of the Acknowledge operation. + public partial class AcknowledgeResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully acknowledged cloud events. + /// or is null. + internal AcknowledgeResult(IEnumerable failedLockTokens, IEnumerable succeededLockTokens) + { + Argument.AssertNotNull(failedLockTokens, nameof(failedLockTokens)); + Argument.AssertNotNull(succeededLockTokens, nameof(succeededLockTokens)); + + FailedLockTokens = failedLockTokens.ToList(); + SucceededLockTokens = succeededLockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully acknowledged cloud events. + /// Keeps track of any properties unknown to the library. + internal AcknowledgeResult(IReadOnlyList failedLockTokens, IReadOnlyList succeededLockTokens, IDictionary serializedAdditionalRawData) + { + FailedLockTokens = failedLockTokens; + SucceededLockTokens = succeededLockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AcknowledgeResult() + { + } + + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + public IReadOnlyList FailedLockTokens { get; } + /// Array of lock tokens for the successfully acknowledged cloud events. + public IReadOnlyList SucceededLockTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AzureMessagingEventGridNamespacesClientOptions.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AzureMessagingEventGridNamespacesClientOptions.cs new file mode 100644 index 000000000000..028d63a6a191 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AzureMessagingEventGridNamespacesClientOptions.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Client options for Azure.Messaging.EventGrid.Namespaces library clients. + public partial class AzureMessagingEventGridNamespacesClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_06_01; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2023-11-01". + V2023_11_01 = 1, + /// Service version "2024-06-01". + V2024_06_01 = 2, + } + + internal string Version { get; } + + /// Initializes new instance of AzureMessagingEventGridNamespacesClientOptions. + public AzureMessagingEventGridNamespacesClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_11_01 => "2023-11-01", + ServiceVersion.V2024_06_01 => "2024-06-01", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.Serialization.cs new file mode 100644 index 000000000000..ece1cd39340e --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class BrokerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockToken"u8); + writer.WriteStringValue(LockToken); + writer.WritePropertyName("deliveryCount"u8); + writer.WriteNumberValue(DeliveryCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BrokerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerProperties(document.RootElement, options); + } + + internal static BrokerProperties DeserializeBrokerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string lockToken = default; + int deliveryCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockToken"u8)) + { + lockToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("deliveryCount"u8)) + { + deliveryCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerProperties(lockToken, deliveryCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerProperties)} does not support writing '{options.Format}' format."); + } + } + + BrokerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BrokerProperties FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBrokerProperties(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.cs new file mode 100644 index 000000000000..78d00f1266d5 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Properties of the Event Broker operation. + internal partial class BrokerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The token of the lock on the event. + /// The attempt count for delivering the event. + /// is null. + internal BrokerProperties(string lockToken, int deliveryCount) + { + Argument.AssertNotNull(lockToken, nameof(lockToken)); + + LockToken = lockToken; + DeliveryCount = deliveryCount; + } + + /// Initializes a new instance of . + /// The token of the lock on the event. + /// The attempt count for delivering the event. + /// Keeps track of any properties unknown to the library. + internal BrokerProperties(string lockToken, int deliveryCount, IDictionary serializedAdditionalRawData) + { + LockToken = lockToken; + DeliveryCount = deliveryCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerProperties() + { + } + + /// The token of the lock on the event. + public string LockToken { get; } + /// The attempt count for delivering the event. + public int DeliveryCount { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.Serialization.cs new file mode 100644 index 000000000000..6f9591d6edd5 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.Serialization.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class CloudEvent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CloudEvent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + if (Optional.IsDefined(Data)) + { + writer.WritePropertyName("data"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Data); +#else + using (JsonDocument document = JsonDocument.Parse(Data)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(DataBase64)) + { + writer.WritePropertyName("data_base64"u8); + writer.WriteBase64StringValue(DataBase64.ToArray(), "D"); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } + writer.WritePropertyName("specversion"u8); + writer.WriteStringValue(Specversion); + if (Optional.IsDefined(Dataschema)) + { + writer.WritePropertyName("dataschema"u8); + writer.WriteStringValue(Dataschema); + } + if (Optional.IsDefined(Datacontenttype)) + { + writer.WritePropertyName("datacontenttype"u8); + writer.WriteStringValue(Datacontenttype); + } + if (Optional.IsDefined(Subject)) + { + writer.WritePropertyName("subject"u8); + writer.WriteStringValue(Subject); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CloudEvent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CloudEvent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudEvent(document.RootElement, options); + } + + internal static CloudEvent DeserializeCloudEvent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string source = default; + BinaryData data = default; + BinaryData dataBase64 = default; + string type = default; + DateTimeOffset? time = default; + string specversion = default; + string dataschema = default; + string datacontenttype = default; + string subject = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("data"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + data = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("data_base64"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataBase64 = BinaryData.FromBytes(property.Value.GetBytesFromBase64("D")); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("specversion"u8)) + { + specversion = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataschema"u8)) + { + dataschema = property.Value.GetString(); + continue; + } + if (property.NameEquals("datacontenttype"u8)) + { + datacontenttype = property.Value.GetString(); + continue; + } + if (property.NameEquals("subject"u8)) + { + subject = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudEvent( + id, + source, + data, + dataBase64, + type, + time, + specversion, + dataschema, + datacontenttype, + subject, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CloudEvent)} does not support writing '{options.Format}' format."); + } + } + + CloudEvent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCloudEvent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudEvent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CloudEvent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCloudEvent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.cs new file mode 100644 index 000000000000..6d49af6075dd --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema. + internal partial class CloudEvent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// An identifier for the event. The combination of id and source must be unique for each distinct event. + /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + /// Type of event related to the originating occurrence. + /// The version of the CloudEvents specification which the event uses. + /// , , or is null. + public CloudEvent(string id, string source, string type, string specversion) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(type, nameof(type)); + Argument.AssertNotNull(specversion, nameof(specversion)); + + Id = id; + Source = source; + Type = type; + Specversion = specversion; + } + + /// Initializes a new instance of . + /// An identifier for the event. The combination of id and source must be unique for each distinct event. + /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + /// Event data specific to the event type. + /// Event data specific to the event type, encoded as a base64 string. + /// Type of event related to the originating occurrence. + /// The time (in UTC) the event was generated, in RFC3339 format. + /// The version of the CloudEvents specification which the event uses. + /// Identifies the schema that data adheres to. + /// Content type of data value. + /// This describes the subject of the event in the context of the event producer (identified by source). + /// Keeps track of any properties unknown to the library. + internal CloudEvent(string id, string source, BinaryData data, BinaryData dataBase64, string type, DateTimeOffset? time, string specversion, string dataschema, string datacontenttype, string subject, IDictionary serializedAdditionalRawData) + { + Id = id; + Source = source; + Data = data; + DataBase64 = dataBase64; + Type = type; + Time = time; + Specversion = specversion; + Dataschema = dataschema; + Datacontenttype = datacontenttype; + Subject = subject; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudEvent() + { + } + + /// An identifier for the event. The combination of id and source must be unique for each distinct event. + public string Id { get; set; } + /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + public string Source { get; set; } + /// + /// Event data specific to the event type. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Data { get; set; } + /// + /// Event data specific to the event type, encoded as a base64 string. + /// + /// To assign a byte[] to this property use . + /// The byte[] will be serialized to a Base64 encoded string. + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromBytes(new byte[] { 1, 2, 3 }) + /// Creates a payload of "AQID". + /// + /// + /// + /// + public BinaryData DataBase64 { get; set; } + /// Type of event related to the originating occurrence. + public string Type { get; set; } + /// The time (in UTC) the event was generated, in RFC3339 format. + public DateTimeOffset? Time { get; set; } + /// The version of the CloudEvents specification which the event uses. + public string Specversion { get; set; } + /// Identifies the schema that data adheres to. + public string Dataschema { get; set; } + /// Content type of data value. + public string Datacontenttype { get; set; } + /// This describes the subject of the event in the context of the event producer (identified by source). + public string Subject { get; set; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridReceiverClient.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridReceiverClient.cs new file mode 100644 index 000000000000..43b45c5c3811 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridReceiverClient.cs @@ -0,0 +1,840 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + // Data plane generated client. + /// The EventGridReceiver service client. + public partial class EventGridReceiverClient + { + private const string AuthorizationHeader = "Authorization"; + private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "SharedAccessKey"; + private static readonly string[] AuthorizationScopes = new string[] { "https://eventgrid.azure.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of EventGridReceiverClient for mocking. + protected EventGridReceiverClient() + { + } + + /// Initializes a new instance of EventGridReceiverClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public EventGridReceiverClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AzureMessagingEventGridNamespacesClientOptions()) + { + } + + /// Initializes a new instance of EventGridReceiverClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public EventGridReceiverClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureMessagingEventGridNamespacesClientOptions()) + { + } + + /// Initializes a new instance of EventGridReceiverClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public EventGridReceiverClient(Uri endpoint, AzureKeyCredential credential, AzureMessagingEventGridNamespacesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureMessagingEventGridNamespacesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader, AuthorizationApiKeyPrefix) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Initializes a new instance of EventGridReceiverClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public EventGridReceiverClient(Uri endpoint, TokenCredential credential, AzureMessagingEventGridNamespacesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureMessagingEventGridNamespacesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Receive a batch of Cloud Events from a subscription. + /// Topic Name. + /// Event Subscription Name. + /// Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. + /// Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> ReceiveAsync(string topicName, string eventSubscriptionName, int? maxEvents = null, TimeSpan? maxWaitTime = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await ReceiveAsync(topicName, eventSubscriptionName, maxEvents, maxWaitTime, context).ConfigureAwait(false); + return Response.FromValue(ReceiveResult.FromResponse(response), response); + } + + /// Receive a batch of Cloud Events from a subscription. + /// Topic Name. + /// Event Subscription Name. + /// Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. + /// Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response Receive(string topicName, string eventSubscriptionName, int? maxEvents = null, TimeSpan? maxWaitTime = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Receive(topicName, eventSubscriptionName, maxEvents, maxWaitTime, context); + return Response.FromValue(ReceiveResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Receive a batch of Cloud Events from a subscription. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. + /// Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task ReceiveAsync(string topicName, string eventSubscriptionName, int? maxEvents, TimeSpan? maxWaitTime, RequestContext context) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Receive"); + scope.Start(); + try + { + using HttpMessage message = CreateReceiveRequest(topicName, eventSubscriptionName, maxEvents, maxWaitTime, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Receive a batch of Cloud Events from a subscription. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. + /// Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Receive(string topicName, string eventSubscriptionName, int? maxEvents, TimeSpan? maxWaitTime, RequestContext context) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Receive"); + scope.Start(); + try + { + using HttpMessage message = CreateReceiveRequest(topicName, eventSubscriptionName, maxEvents, maxWaitTime, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> AcknowledgeAsync(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + AcknowledgeRequest acknowledgeRequest = new AcknowledgeRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AcknowledgeAsync(topicName, eventSubscriptionName, acknowledgeRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(AcknowledgeResult.FromResponse(response), response); + } + + /// Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response Acknowledge(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + AcknowledgeRequest acknowledgeRequest = new AcknowledgeRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Acknowledge(topicName, eventSubscriptionName, acknowledgeRequest.ToRequestContent(), context); + return Response.FromValue(AcknowledgeResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task AcknowledgeAsync(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Acknowledge"); + scope.Start(); + try + { + using HttpMessage message = CreateAcknowledgeRequest(topicName, eventSubscriptionName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Acknowledge(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Acknowledge"); + scope.Start(); + try + { + using HttpMessage message = CreateAcknowledgeRequest(topicName, eventSubscriptionName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// Release cloud events with the specified delay in seconds. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> ReleaseAsync(string topicName, string eventSubscriptionName, IEnumerable lockTokens, ReleaseDelay? releaseDelayInSeconds = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + ReleaseRequest releaseRequest = new ReleaseRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await ReleaseAsync(topicName, eventSubscriptionName, releaseRequest.ToRequestContent(), releaseDelayInSeconds?.ToString(), context).ConfigureAwait(false); + return Response.FromValue(ReleaseResult.FromResponse(response), response); + } + + /// Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// Release cloud events with the specified delay in seconds. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response Release(string topicName, string eventSubscriptionName, IEnumerable lockTokens, ReleaseDelay? releaseDelayInSeconds = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + ReleaseRequest releaseRequest = new ReleaseRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Release(topicName, eventSubscriptionName, releaseRequest.ToRequestContent(), releaseDelayInSeconds?.ToString(), context); + return Response.FromValue(ReleaseResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// Release cloud events with the specified delay in seconds. Allowed values: "0" | "10" | "60" | "600" | "3600". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task ReleaseAsync(string topicName, string eventSubscriptionName, RequestContent content, string releaseDelayInSeconds = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Release"); + scope.Start(); + try + { + using HttpMessage message = CreateReleaseRequest(topicName, eventSubscriptionName, content, releaseDelayInSeconds, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// Release cloud events with the specified delay in seconds. Allowed values: "0" | "10" | "60" | "600" | "3600". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Release(string topicName, string eventSubscriptionName, RequestContent content, string releaseDelayInSeconds = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Release"); + scope.Start(); + try + { + using HttpMessage message = CreateReleaseRequest(topicName, eventSubscriptionName, content, releaseDelayInSeconds, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> RejectAsync(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + RejectRequest rejectRequest = new RejectRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await RejectAsync(topicName, eventSubscriptionName, rejectRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(RejectResult.FromResponse(response), response); + } + + /// Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response Reject(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + RejectRequest rejectRequest = new RejectRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Reject(topicName, eventSubscriptionName, rejectRequest.ToRequestContent(), context); + return Response.FromValue(RejectResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task RejectAsync(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Reject"); + scope.Start(); + try + { + using HttpMessage message = CreateRejectRequest(topicName, eventSubscriptionName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Reject(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Reject"); + scope.Start(); + try + { + using HttpMessage message = CreateRejectRequest(topicName, eventSubscriptionName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> RenewLocksAsync(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + RenewLocksRequest renewLocksRequest = new RenewLocksRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await RenewLocksAsync(topicName, eventSubscriptionName, renewLocksRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(RenewLocksResult.FromResponse(response), response); + } + + /// Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response RenewLocks(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + RenewLocksRequest renewLocksRequest = new RenewLocksRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = RenewLocks(topicName, eventSubscriptionName, renewLocksRequest.ToRequestContent(), context); + return Response.FromValue(RenewLocksResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task RenewLocksAsync(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.RenewLocks"); + scope.Start(); + try + { + using HttpMessage message = CreateRenewLocksRequest(topicName, eventSubscriptionName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response RenewLocks(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.RenewLocks"); + scope.Start(); + try + { + using HttpMessage message = CreateRenewLocksRequest(topicName, eventSubscriptionName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateReceiveRequest(string topicName, string eventSubscriptionName, int? maxEvents, TimeSpan? maxWaitTime, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":receive", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxEvents != null) + { + uri.AppendQuery("maxEvents", maxEvents.Value, true); + } + if (maxWaitTime != null) + { + uri.AppendQuery("maxWaitTime", maxWaitTime.Value, "%s", true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAcknowledgeRequest(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":acknowledge", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateReleaseRequest(string topicName, string eventSubscriptionName, RequestContent content, string releaseDelayInSeconds, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":release", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (releaseDelayInSeconds != null) + { + uri.AppendQuery("releaseDelayInSeconds", releaseDelayInSeconds, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateRejectRequest(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":reject", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateRenewLocksRequest(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":renewLock", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridSenderClient.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridSenderClient.cs new file mode 100644 index 000000000000..7823b6e8d6e3 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridSenderClient.cs @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + // Data plane generated client. + /// The EventGridSender service client. + public partial class EventGridSenderClient + { + private const string AuthorizationHeader = "Authorization"; + private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "SharedAccessKey"; + private static readonly string[] AuthorizationScopes = new string[] { "https://eventgrid.azure.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of EventGridSenderClient for mocking. + protected EventGridSenderClient() + { + } + + /// Initializes a new instance of EventGridSenderClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public EventGridSenderClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AzureMessagingEventGridNamespacesClientOptions()) + { + } + + /// Initializes a new instance of EventGridSenderClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public EventGridSenderClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureMessagingEventGridNamespacesClientOptions()) + { + } + + /// Initializes a new instance of EventGridSenderClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public EventGridSenderClient(Uri endpoint, AzureKeyCredential credential, AzureMessagingEventGridNamespacesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureMessagingEventGridNamespacesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader, AuthorizationApiKeyPrefix) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Initializes a new instance of EventGridSenderClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public EventGridSenderClient(Uri endpoint, TokenCredential credential, AzureMessagingEventGridNamespacesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureMessagingEventGridNamespacesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Publish a single Cloud Event to a namespace topic. + /// Topic Name. + /// Single Cloud Event being published. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + internal virtual async Task> SendAsync(string topicName, CloudEvent @event, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(@event, nameof(@event)); + + using RequestContent content = @event.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await SendAsync(topicName, content, context).ConfigureAwait(false); + return Response.FromValue(PublishResult.FromResponse(response), response); + } + + /// Publish a single Cloud Event to a namespace topic. + /// Topic Name. + /// Single Cloud Event being published. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + internal virtual Response Send(string topicName, CloudEvent @event, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(@event, nameof(@event)); + + using RequestContent content = @event.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Send(topicName, content, context); + return Response.FromValue(PublishResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Publish a single Cloud Event to a namespace topic. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task SendAsync(string topicName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridSenderClient.Send"); + scope.Start(); + try + { + using HttpMessage message = CreateSendRequest(topicName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Publish a single Cloud Event to a namespace topic. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Send(string topicName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridSenderClient.Send"); + scope.Start(); + try + { + using HttpMessage message = CreateSendRequest(topicName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Publish a batch of Cloud Events to a namespace topic. + /// Topic Name. + /// Array of Cloud Events being published. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + internal virtual async Task> SendEventsAsync(string topicName, IEnumerable events, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(events, nameof(events)); + + using RequestContent content = RequestContentHelper.FromEnumerable(events); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await SendEventsAsync(topicName, content, context).ConfigureAwait(false); + return Response.FromValue(PublishResult.FromResponse(response), response); + } + + /// Publish a batch of Cloud Events to a namespace topic. + /// Topic Name. + /// Array of Cloud Events being published. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + internal virtual Response SendEvents(string topicName, IEnumerable events, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(events, nameof(events)); + + using RequestContent content = RequestContentHelper.FromEnumerable(events); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = SendEvents(topicName, content, context); + return Response.FromValue(PublishResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Publish a batch of Cloud Events to a namespace topic. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task SendEventsAsync(string topicName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridSenderClient.SendEvents"); + scope.Start(); + try + { + using HttpMessage message = CreateSendEventsRequest(topicName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Publish a batch of Cloud Events to a namespace topic. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response SendEvents(string topicName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridSenderClient.SendEvents"); + scope.Start(); + try + { + using HttpMessage message = CreateSendEventsRequest(topicName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateSendRequest(string topicName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath(":publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/cloudevents+json; charset=utf-8"); + request.Content = content; + return message; + } + + internal HttpMessage CreateSendEventsRequest(string topicName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath(":publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/cloudevents-batch+json; charset=utf-8"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.Serialization.cs new file mode 100644 index 000000000000..bdce37c4d667 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class FailedLockToken : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailedLockToken)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockToken"u8); + writer.WriteStringValue(LockToken); + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FailedLockToken IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailedLockToken)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFailedLockToken(document.RootElement, options); + } + + internal static FailedLockToken DeserializeFailedLockToken(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string lockToken = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockToken"u8)) + { + lockToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("error"u8)) + { + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FailedLockToken(lockToken, error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FailedLockToken)} does not support writing '{options.Format}' format."); + } + } + + FailedLockToken IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFailedLockToken(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FailedLockToken)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FailedLockToken FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFailedLockToken(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.cs similarity index 52% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.cs index 84def29fc528..a098a39a8a15 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterServicePrincipalProfile.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. - public partial class ManagedClusterServicePrincipalProfile + /// Failed LockToken information. + public partial class FailedLockToken { /// /// Keeps track of any properties unknown to the library. @@ -45,35 +45,38 @@ public partial class ManagedClusterServicePrincipalProfile /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The ID for the service principal. - /// is null. - public ManagedClusterServicePrincipalProfile(string clientId) + /// Initializes a new instance of . + /// The lock token of an entry in the request. + /// Error information of the failed operation result for the lock token in the request. + /// or is null. + internal FailedLockToken(string lockToken, ResponseError error) { - Argument.AssertNotNull(clientId, nameof(clientId)); + Argument.AssertNotNull(lockToken, nameof(lockToken)); + Argument.AssertNotNull(error, nameof(error)); - ClientId = clientId; + LockToken = lockToken; + Error = error; } - /// Initializes a new instance of . - /// The ID for the service principal. - /// The secret password associated with the service principal in plain text. + /// Initializes a new instance of . + /// The lock token of an entry in the request. + /// Error information of the failed operation result for the lock token in the request. /// Keeps track of any properties unknown to the library. - internal ManagedClusterServicePrincipalProfile(string clientId, string secret, IDictionary serializedAdditionalRawData) + internal FailedLockToken(string lockToken, ResponseError error, IDictionary serializedAdditionalRawData) { - ClientId = clientId; - Secret = secret; + LockToken = lockToken; + Error = error; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ManagedClusterServicePrincipalProfile() + /// Initializes a new instance of for deserialization. + internal FailedLockToken() { } - /// The ID for the service principal. - public string ClientId { get; set; } - /// The secret password associated with the service principal in plain text. - public string Secret { get; set; } + /// The lock token of an entry in the request. + public string LockToken { get; } + /// Error information of the failed operation result for the lock token in the request. + public ResponseError Error { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Argument.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..7f53b5f11f4a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..da590bd8315a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingList.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..86ec5baff961 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..905e7c682f17 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Optional.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..9b1683fa02e9 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/RequestContentHelper.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/RequestContentHelper.cs new file mode 100644 index 000000000000..61d8e1dae3f7 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/RequestContentHelper.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal static class RequestContentHelper + { + public static RequestContent FromEnumerable(IEnumerable enumerable) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + content.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(IEnumerable enumerable) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + if (item == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item); +#else + using (JsonDocument document = JsonDocument.Parse(item)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(ReadOnlySpan span) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + for (int i = 0; i < span.Length; i++) + { + content.JsonWriter.WriteObjectValue(span[i], ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + where TValue : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + content.JsonWriter.WriteObjectValue(item.Value, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + if (item.Value == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromObject(object value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(value, ModelSerializationExtensions.WireOptions); + return content; + } + + public static RequestContent FromObject(BinaryData value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(value); +#else + using (JsonDocument document = JsonDocument.Parse(value)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..78323219e281 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesClientBuilderExtensions.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesClientBuilderExtensions.cs new file mode 100644 index 000000000000..e710c7ce03c9 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesClientBuilderExtensions.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core.Extensions; +using Azure.Messaging.EventGrid.Namespaces; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add , to client builder. + public static partial class MessagingEventGridNamespacesClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new EventGridSenderClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + public static IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new EventGridSenderClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new EventGridReceiverClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + public static IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new EventGridReceiverClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesModelFactory.cs new file mode 100644 index 000000000000..f78936f09961 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesModelFactory.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Model factory for models. + public static partial class MessagingEventGridNamespacesModelFactory + { + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully acknowledged cloud events. + /// A new instance for mocking. + public static AcknowledgeResult AcknowledgeResult(IEnumerable failedLockTokens = null, IEnumerable succeededLockTokens = null) + { + failedLockTokens ??= new List(); + succeededLockTokens ??= new List(); + + return new AcknowledgeResult(failedLockTokens?.ToList(), succeededLockTokens?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The lock token of an entry in the request. + /// Error information of the failed operation result for the lock token in the request. + /// A new instance for mocking. + public static FailedLockToken FailedLockToken(string lockToken = null, ResponseError error = null) + { + return new FailedLockToken(lockToken, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully released cloud events. + /// A new instance for mocking. + public static ReleaseResult ReleaseResult(IEnumerable failedLockTokens = null, IEnumerable succeededLockTokens = null) + { + failedLockTokens ??= new List(); + succeededLockTokens ??= new List(); + + return new ReleaseResult(failedLockTokens?.ToList(), succeededLockTokens?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully rejected cloud events. + /// A new instance for mocking. + public static RejectResult RejectResult(IEnumerable failedLockTokens = null, IEnumerable succeededLockTokens = null) + { + failedLockTokens ??= new List(); + succeededLockTokens ??= new List(); + + return new RejectResult(failedLockTokens?.ToList(), succeededLockTokens?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully renewed locks. + /// A new instance for mocking. + public static RenewLocksResult RenewLocksResult(IEnumerable failedLockTokens = null, IEnumerable succeededLockTokens = null) + { + failedLockTokens ??= new List(); + succeededLockTokens ??= new List(); + + return new RenewLocksResult(failedLockTokens?.ToList(), succeededLockTokens?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.Serialization.cs similarity index 59% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.Serialization.cs index 6a346b695682..d6a82190d386 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/DailySchedule.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.Serialization.cs @@ -11,23 +11,21 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Messaging.EventGrid.Namespaces { - internal partial class DailySchedule : IUtf8JsonSerializable, IJsonModel + internal partial class PublishResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DailySchedule)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PublishResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("intervalDays"u8); - writer.WriteNumberValue(IntervalDays); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +44,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt writer.WriteEndObject(); } - DailySchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PublishResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DailySchedule)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PublishResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDailySchedule(document.RootElement, options); + return DeserializePublishResult(document.RootElement, options); } - internal static DailySchedule DeserializeDailySchedule(JsonElement element, ModelReaderWriterOptions options = null) + internal static PublishResult DeserializePublishResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,54 +64,64 @@ internal static DailySchedule DeserializeDailySchedule(JsonElement element, Mode { return null; } - int intervalDays = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("intervalDays"u8)) - { - intervalDays = property.Value.GetInt32(); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new DailySchedule(intervalDays, serializedAdditionalRawData); + return new PublishResult(serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DailySchedule)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PublishResult)} does not support writing '{options.Format}' format."); } } - DailySchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PublishResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDailySchedule(document.RootElement, options); + return DeserializePublishResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DailySchedule)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PublishResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PublishResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePublishResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.cs similarity index 67% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.cs index f3117204a3e6..1427f94a2dbc 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesPatchVersion.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// Kubernetes patch version profile. - public partial class KubernetesPatchVersion + /// The result of the Publish operation. + internal partial class PublishResult { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,16 @@ public partial class KubernetesPatchVersion /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal KubernetesPatchVersion() + /// Initializes a new instance of . + internal PublishResult() { - Upgrades = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Possible upgrade path for given patch version. + /// Initializes a new instance of . /// Keeps track of any properties unknown to the library. - internal KubernetesPatchVersion(IReadOnlyList upgrades, IDictionary serializedAdditionalRawData) + internal PublishResult(IDictionary serializedAdditionalRawData) { - Upgrades = upgrades; _serializedAdditionalRawData = serializedAdditionalRawData; } - - /// Possible upgrade path for given patch version. - public IReadOnlyList Upgrades { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.Serialization.cs new file mode 100644 index 000000000000..02d175e5152c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class ReceiveDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReceiveDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("brokerProperties"u8); + writer.WriteObjectValue(BrokerProperties, options); + writer.WritePropertyName("event"u8); + writer.WriteObjectValue(Event, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReceiveDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReceiveDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReceiveDetails(document.RootElement, options); + } + + internal static ReceiveDetails DeserializeReceiveDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerProperties brokerProperties = default; + CloudEvent @event = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("brokerProperties"u8)) + { + brokerProperties = BrokerProperties.DeserializeBrokerProperties(property.Value, options); + continue; + } + if (property.NameEquals("event"u8)) + { + @event = CloudEvent.DeserializeCloudEvent(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReceiveDetails(brokerProperties, @event, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReceiveDetails)} does not support writing '{options.Format}' format."); + } + } + + ReceiveDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReceiveDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReceiveDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReceiveDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReceiveDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.cs new file mode 100644 index 000000000000..13b99065b26d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Receive operation details per Cloud Event. + internal partial class ReceiveDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Event Broker details. + /// Cloud Event details. + /// or is null. + internal ReceiveDetails(BrokerProperties brokerProperties, CloudEvent @event) + { + Argument.AssertNotNull(brokerProperties, nameof(brokerProperties)); + Argument.AssertNotNull(@event, nameof(@event)); + + BrokerProperties = brokerProperties; + Event = @event; + } + + /// Initializes a new instance of . + /// The Event Broker details. + /// Cloud Event details. + /// Keeps track of any properties unknown to the library. + internal ReceiveDetails(BrokerProperties brokerProperties, CloudEvent @event, IDictionary serializedAdditionalRawData) + { + BrokerProperties = brokerProperties; + Event = @event; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReceiveDetails() + { + } + + /// The Event Broker details. + public BrokerProperties BrokerProperties { get; } + /// Cloud Event details. + public CloudEvent Event { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.Serialization.cs similarity index 51% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.Serialization.cs index b97390e22ad7..d54ddbeb506b 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceSshConfiguration.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.Serialization.cs @@ -11,24 +11,24 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Messaging.EventGrid.Namespaces { - public partial class ContainerServiceSshConfiguration : IUtf8JsonSerializable, IJsonModel + internal partial class ReceiveResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceSshConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ReceiveResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("publicKeys"u8); + writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in PublicKeys) + foreach (var item in Details) { writer.WriteObjectValue(item, options); } @@ -51,19 +51,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteEndObject(); } - ContainerServiceSshConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ReceiveResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceSshConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ReceiveResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceSshConfiguration(document.RootElement, options); + return DeserializeReceiveResult(document.RootElement, options); } - internal static ContainerServiceSshConfiguration DeserializeContainerServiceSshConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static ReceiveResult DeserializeReceiveResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,19 +71,19 @@ internal static ContainerServiceSshConfiguration DeserializeContainerServiceSshC { return null; } - IList publicKeys = default; + IReadOnlyList value = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("publicKeys"u8)) + if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ContainerServiceSshPublicKey.DeserializeContainerServiceSshPublicKey(item, options)); + array.Add(ReceiveDetails.DeserializeReceiveDetails(item, options)); } - publicKeys = array; + value = array; continue; } if (options.Format != "W") @@ -92,38 +92,54 @@ internal static ContainerServiceSshConfiguration DeserializeContainerServiceSshC } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceSshConfiguration(publicKeys, serializedAdditionalRawData); + return new ReceiveResult(value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ContainerServiceSshConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ReceiveResult)} does not support writing '{options.Format}' format."); } } - ContainerServiceSshConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ReceiveResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceSshConfiguration(document.RootElement, options); + return DeserializeReceiveResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceSshConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ReceiveResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReceiveResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReceiveResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.cs similarity index 59% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.cs index 0f263f1cb481..394c066f5f88 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceEndpointDependency.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// A domain name that AKS agent nodes are reaching at. - public partial class ContainerServiceEndpointDependency + /// Details of the Receive operation response. + internal partial class ReceiveResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,31 @@ public partial class ContainerServiceEndpointDependency /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ContainerServiceEndpointDependency() + /// Initializes a new instance of . + /// Array of receive responses, one per cloud event. + /// is null. + internal ReceiveResult(IEnumerable details) { - EndpointDetails = new ChangeTrackingList(); + Argument.AssertNotNull(details, nameof(details)); + + Details = details.ToList(); } - /// Initializes a new instance of . - /// The domain name of the dependency. - /// The Ports and Protocols used when connecting to domainName. + /// Initializes a new instance of . + /// Array of receive responses, one per cloud event. /// Keeps track of any properties unknown to the library. - internal ContainerServiceEndpointDependency(string domainName, IReadOnlyList endpointDetails, IDictionary serializedAdditionalRawData) + internal ReceiveResult(IReadOnlyList details, IDictionary serializedAdditionalRawData) { - DomainName = domainName; - EndpointDetails = endpointDetails; + Details = details; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The domain name of the dependency. - public string DomainName { get; } - /// The Ports and Protocols used when connecting to domainName. - public IReadOnlyList EndpointDetails { get; } + /// Initializes a new instance of for deserialization. + internal ReceiveResult() + { + } + + /// Array of receive responses, one per cloud event. + public IReadOnlyList Details { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.Serialization.cs new file mode 100644 index 000000000000..b5c0f789ea08 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class RejectRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RejectRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockTokens"u8); + writer.WriteStartArray(); + foreach (var item in LockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RejectRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RejectRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRejectRequest(document.RootElement, options); + } + + internal static RejectRequest DeserializeRejectRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList lockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + lockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RejectRequest(lockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RejectRequest)} does not support writing '{options.Format}' format."); + } + } + + RejectRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRejectRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RejectRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RejectRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRejectRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.cs similarity index 60% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.cs index dc97928c2796..e64cfb88fa65 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterPodIdentityProvisioningInfo.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// The ManagedClusterPodIdentityProvisioningInfo. - internal partial class ManagedClusterPodIdentityProvisioningInfo + /// The RejectRequest. + internal partial class RejectRequest { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,31 @@ internal partial class ManagedClusterPodIdentityProvisioningInfo /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ManagedClusterPodIdentityProvisioningInfo() + /// Initializes a new instance of . + /// Array of lock tokens. + /// is null. + internal RejectRequest(IEnumerable lockTokens) { + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + LockTokens = lockTokens.ToList(); } - /// Initializes a new instance of . - /// Pod identity assignment error (if any). + /// Initializes a new instance of . + /// Array of lock tokens. /// Keeps track of any properties unknown to the library. - internal ManagedClusterPodIdentityProvisioningInfo(ManagedClusterPodIdentityProvisioningError error, IDictionary serializedAdditionalRawData) + internal RejectRequest(IReadOnlyList lockTokens, IDictionary serializedAdditionalRawData) { - Error = error; + LockTokens = lockTokens; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Pod identity assignment error (if any). - internal ManagedClusterPodIdentityProvisioningError Error { get; } - /// Details about the error. - public ResponseError ErrorDetail + /// Initializes a new instance of for deserialization. + internal RejectRequest() { - get => Error?.ErrorDetail; } + + /// Array of lock tokens. + public IReadOnlyList LockTokens { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.Serialization.cs new file mode 100644 index 000000000000..2e9d4852d1b1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class RejectResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RejectResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("failedLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in FailedLockTokens) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("succeededLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in SucceededLockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RejectResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RejectResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRejectResult(document.RootElement, options); + } + + internal static RejectResult DeserializeRejectResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList failedLockTokens = default; + IReadOnlyList succeededLockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failedLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailedLockToken.DeserializeFailedLockToken(item, options)); + } + failedLockTokens = array; + continue; + } + if (property.NameEquals("succeededLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + succeededLockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RejectResult(failedLockTokens, succeededLockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RejectResult)} does not support writing '{options.Format}' format."); + } + } + + RejectResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRejectResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RejectResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RejectResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRejectResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.cs new file mode 100644 index 000000000000..1b8a06457430 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The result of the Reject operation. + public partial class RejectResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully rejected cloud events. + /// or is null. + internal RejectResult(IEnumerable failedLockTokens, IEnumerable succeededLockTokens) + { + Argument.AssertNotNull(failedLockTokens, nameof(failedLockTokens)); + Argument.AssertNotNull(succeededLockTokens, nameof(succeededLockTokens)); + + FailedLockTokens = failedLockTokens.ToList(); + SucceededLockTokens = succeededLockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully rejected cloud events. + /// Keeps track of any properties unknown to the library. + internal RejectResult(IReadOnlyList failedLockTokens, IReadOnlyList succeededLockTokens, IDictionary serializedAdditionalRawData) + { + FailedLockTokens = failedLockTokens; + SucceededLockTokens = succeededLockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RejectResult() + { + } + + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + public IReadOnlyList FailedLockTokens { get; } + /// Array of lock tokens for the successfully rejected cloud events. + public IReadOnlyList SucceededLockTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseDelay.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseDelay.cs new file mode 100644 index 000000000000..498243b8a657 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseDelay.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Supported delays for release operation. + public readonly partial struct ReleaseDelay : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReleaseDelay(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoDelayValue = "0"; + private const string TenSecondsValue = "10"; + private const string OneMinuteValue = "60"; + private const string TenMinutesValue = "600"; + private const string OneHourValue = "3600"; + + /// Release the event after 0 seconds. + public static ReleaseDelay NoDelay { get; } = new ReleaseDelay(NoDelayValue); + /// Release the event after 10 seconds. + public static ReleaseDelay TenSeconds { get; } = new ReleaseDelay(TenSecondsValue); + /// Release the event after 60 seconds. + public static ReleaseDelay OneMinute { get; } = new ReleaseDelay(OneMinuteValue); + /// Release the event after 600 seconds. + public static ReleaseDelay TenMinutes { get; } = new ReleaseDelay(TenMinutesValue); + /// Release the event after 3600 seconds. + public static ReleaseDelay OneHour { get; } = new ReleaseDelay(OneHourValue); + /// Determines if two values are the same. + public static bool operator ==(ReleaseDelay left, ReleaseDelay right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReleaseDelay left, ReleaseDelay right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ReleaseDelay(string value) => new ReleaseDelay(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReleaseDelay other && Equals(other); + /// + public bool Equals(ReleaseDelay other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.Serialization.cs new file mode 100644 index 000000000000..b18dd3aad27e --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class ReleaseRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReleaseRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockTokens"u8); + writer.WriteStartArray(); + foreach (var item in LockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReleaseRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReleaseRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReleaseRequest(document.RootElement, options); + } + + internal static ReleaseRequest DeserializeReleaseRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList lockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + lockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReleaseRequest(lockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReleaseRequest)} does not support writing '{options.Format}' format."); + } + } + + ReleaseRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReleaseRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReleaseRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReleaseRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReleaseRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.cs new file mode 100644 index 000000000000..8081e38d2411 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The ReleaseRequest. + internal partial class ReleaseRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of lock tokens. + /// is null. + internal ReleaseRequest(IEnumerable lockTokens) + { + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + LockTokens = lockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of lock tokens. + /// Keeps track of any properties unknown to the library. + internal ReleaseRequest(IReadOnlyList lockTokens, IDictionary serializedAdditionalRawData) + { + LockTokens = lockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReleaseRequest() + { + } + + /// Array of lock tokens. + public IReadOnlyList LockTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.Serialization.cs new file mode 100644 index 000000000000..a4a27af1a013 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class ReleaseResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReleaseResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("failedLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in FailedLockTokens) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("succeededLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in SucceededLockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReleaseResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReleaseResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReleaseResult(document.RootElement, options); + } + + internal static ReleaseResult DeserializeReleaseResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList failedLockTokens = default; + IReadOnlyList succeededLockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failedLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailedLockToken.DeserializeFailedLockToken(item, options)); + } + failedLockTokens = array; + continue; + } + if (property.NameEquals("succeededLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + succeededLockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReleaseResult(failedLockTokens, succeededLockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReleaseResult)} does not support writing '{options.Format}' format."); + } + } + + ReleaseResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReleaseResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReleaseResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReleaseResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReleaseResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.cs new file mode 100644 index 000000000000..a12f10dc025a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The result of the Release operation. + public partial class ReleaseResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully released cloud events. + /// or is null. + internal ReleaseResult(IEnumerable failedLockTokens, IEnumerable succeededLockTokens) + { + Argument.AssertNotNull(failedLockTokens, nameof(failedLockTokens)); + Argument.AssertNotNull(succeededLockTokens, nameof(succeededLockTokens)); + + FailedLockTokens = failedLockTokens.ToList(); + SucceededLockTokens = succeededLockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully released cloud events. + /// Keeps track of any properties unknown to the library. + internal ReleaseResult(IReadOnlyList failedLockTokens, IReadOnlyList succeededLockTokens, IDictionary serializedAdditionalRawData) + { + FailedLockTokens = failedLockTokens; + SucceededLockTokens = succeededLockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReleaseResult() + { + } + + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + public IReadOnlyList FailedLockTokens { get; } + /// Array of lock tokens for the successfully released cloud events. + public IReadOnlyList SucceededLockTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.Serialization.cs new file mode 100644 index 000000000000..65ebd81a6091 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class RenewLocksRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RenewLocksRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockTokens"u8); + writer.WriteStartArray(); + foreach (var item in LockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RenewLocksRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RenewLocksRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRenewLocksRequest(document.RootElement, options); + } + + internal static RenewLocksRequest DeserializeRenewLocksRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList lockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + lockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RenewLocksRequest(lockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RenewLocksRequest)} does not support writing '{options.Format}' format."); + } + } + + RenewLocksRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRenewLocksRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RenewLocksRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RenewLocksRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRenewLocksRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.cs new file mode 100644 index 000000000000..60ac0dd1be38 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The RenewLocksRequest. + internal partial class RenewLocksRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of lock tokens. + /// is null. + internal RenewLocksRequest(IEnumerable lockTokens) + { + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + LockTokens = lockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of lock tokens. + /// Keeps track of any properties unknown to the library. + internal RenewLocksRequest(IReadOnlyList lockTokens, IDictionary serializedAdditionalRawData) + { + LockTokens = lockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RenewLocksRequest() + { + } + + /// Array of lock tokens. + public IReadOnlyList LockTokens { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.Serialization.cs similarity index 51% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.Serialization.cs index 9472bbdb3b34..f96a0e876430 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioServiceMesh.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.Serialization.cs @@ -11,41 +11,35 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.Messaging.EventGrid.Namespaces { - public partial class IstioServiceMesh : IUtf8JsonSerializable, IJsonModel + public partial class RenewLocksResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioServiceMesh)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RenewLocksResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Components)) + writer.WritePropertyName("failedLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in FailedLockTokens) { - writer.WritePropertyName("components"u8); - writer.WriteObjectValue(Components, options); + writer.WriteObjectValue(item, options); } - if (Optional.IsDefined(CertificateAuthority)) + writer.WriteEndArray(); + writer.WritePropertyName("succeededLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in SucceededLockTokens) { - writer.WritePropertyName("certificateAuthority"u8); - writer.WriteObjectValue(CertificateAuthority, options); - } - if (Optional.IsCollectionDefined(Revisions)) - { - writer.WritePropertyName("revisions"u8); - writer.WriteStartArray(); - foreach (var item in Revisions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); + writer.WriteStringValue(item); } + writer.WriteEndArray(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -64,19 +58,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteEndObject(); } - IstioServiceMesh IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RenewLocksResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IstioServiceMesh)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RenewLocksResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIstioServiceMesh(document.RootElement, options); + return DeserializeRenewLocksResult(document.RootElement, options); } - internal static IstioServiceMesh DeserializeIstioServiceMesh(JsonElement element, ModelReaderWriterOptions options = null) + internal static RenewLocksResult DeserializeRenewLocksResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -84,43 +78,30 @@ internal static IstioServiceMesh DeserializeIstioServiceMesh(JsonElement element { return null; } - IstioComponents components = default; - IstioCertificateAuthority certificateAuthority = default; - IList revisions = default; + IReadOnlyList failedLockTokens = default; + IReadOnlyList succeededLockTokens = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("components"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - components = IstioComponents.DeserializeIstioComponents(property.Value, options); - continue; - } - if (property.NameEquals("certificateAuthority"u8)) + if (property.NameEquals("failedLockTokens"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(FailedLockToken.DeserializeFailedLockToken(item, options)); } - certificateAuthority = IstioCertificateAuthority.DeserializeIstioCertificateAuthority(property.Value, options); + failedLockTokens = array; continue; } - if (property.NameEquals("revisions"u8)) + if (property.NameEquals("succeededLockTokens"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { array.Add(item.GetString()); } - revisions = array; + succeededLockTokens = array; continue; } if (options.Format != "W") @@ -129,38 +110,54 @@ internal static IstioServiceMesh DeserializeIstioServiceMesh(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new IstioServiceMesh(components, certificateAuthority, revisions ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new RenewLocksResult(failedLockTokens, succeededLockTokens, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(IstioServiceMesh)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RenewLocksResult)} does not support writing '{options.Format}' format."); } } - IstioServiceMesh IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RenewLocksResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIstioServiceMesh(document.RootElement, options); + return DeserializeRenewLocksResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IstioServiceMesh)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RenewLocksResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RenewLocksResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRenewLocksResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.cs new file mode 100644 index 000000000000..5f3f38c60eff --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The result of the RenewLock operation. + public partial class RenewLocksResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully renewed locks. + /// or is null. + internal RenewLocksResult(IEnumerable failedLockTokens, IEnumerable succeededLockTokens) + { + Argument.AssertNotNull(failedLockTokens, nameof(failedLockTokens)); + Argument.AssertNotNull(succeededLockTokens, nameof(succeededLockTokens)); + + FailedLockTokens = failedLockTokens.ToList(); + SucceededLockTokens = succeededLockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully renewed locks. + /// Keeps track of any properties unknown to the library. + internal RenewLocksResult(IReadOnlyList failedLockTokens, IReadOnlyList succeededLockTokens, IDictionary serializedAdditionalRawData) + { + FailedLockTokens = failedLockTokens; + SucceededLockTokens = succeededLockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RenewLocksResult() + { + } + + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + public IReadOnlyList FailedLockTokens { get; } + /// Array of lock tokens for the successfully renewed locks. + public IReadOnlyList SucceededLockTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Properties/AssemblyInfo.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..d5b2dd2228ed --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Messaging.EventGrid.Namespaces.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/tsp-location.yaml b/sdk/eventgrid/Azure.Messaging.EventGridV2/tsp-location.yaml new file mode 100644 index 000000000000..2be098b2ab23 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/eventgrid/Azure.Messaging.EventGrid +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml b/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml index 0544d66822a9..5b77dd6f2181 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml +++ b/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/fabric/Microsoft.Fabric.Management -commit: 2812cf7809bf4ebb00edcbba09a2af1d74ad7d76 -repo: Azure/azure-rest-api-specs +commit: 7594b7d0821b951429204ec732c6916d27ae5fdc +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: