From e63134034810e595a47396b6908dc208ce2b3da9 Mon Sep 17 00:00:00 2001 From: Xinyu He Date: Fri, 16 Aug 2024 15:27:44 +0800 Subject: [PATCH 01/20] Generate Code --- ...ceManager.ContainerOrchestratorRuntime.sln | 65 +++ .../CHANGELOG.md | 17 + .../Directory.Build.props | 6 + .../README.md | 80 +++ .../assets.json | 6 + ...ontainerOrchestratorRuntime.Samples.csproj | 10 + .../Samples/Sample_BgpPeerCollection.cs | 190 +++++++ .../Samples/Sample_BgpPeerResource.cs | 110 ++++ .../Samples/Sample_LoadBalancerCollection.cs | 197 +++++++ .../Samples/Sample_LoadBalancerResource.cs | 117 ++++ .../Samples/Sample_ServiceResource.cs | 105 ++++ .../Sample_ServiceResourceCollection.cs | 185 +++++++ .../Samples/Sample_StorageClassResource.cs | 115 ++++ .../Sample_StorageClassResourceCollection.cs | 189 +++++++ ...anager.ContainerOrchestratorRuntime.csproj | 8 + ...ontainerOrchestratorRuntimeModelFactory.cs | 141 +++++ .../src/Generated/BgpPeerCollection.cs | 483 ++++++++++++++++ .../Generated/BgpPeerData.Serialization.cs | 241 ++++++++ .../src/Generated/BgpPeerData.cs | 87 +++ .../BgpPeerResource.Serialization.cs | 26 + .../src/Generated/BgpPeerResource.cs | 349 ++++++++++++ .../ContainerOrchestratorRuntimeExtensions.cs | 484 ++++++++++++++++ ...leContainerOrchestratorRuntimeArmClient.cs | 376 +++++++++++++ .../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/LoadBalancerCollection.cs | 483 ++++++++++++++++ .../LoadBalancerData.Serialization.cs | 292 ++++++++++ .../src/Generated/LoadBalancerData.cs | 94 ++++ .../LoadBalancerResource.Serialization.cs | 26 + .../src/Generated/LoadBalancerResource.cs | 349 ++++++++++++ .../BgpPeerOperationSource.cs | 38 ++ ...ontainerOrchestratorRuntimeArmOperation.cs | 94 ++++ ...ainerOrchestratorRuntimeArmOperationOfT.cs | 100 ++++ .../LoadBalancerOperationSource.cs | 38 ++ .../StorageClassResourceOperationSource.cs | 38 ++ .../src/Generated/Models/AccessMode.cs | 51 ++ .../src/Generated/Models/AdvertiseMode.cs | 54 ++ .../Models/BgpPeerListResult.Serialization.cs | 144 +++++ .../src/Generated/Models/BgpPeerListResult.cs | 80 +++ ...torageClassTypeProperties.Serialization.cs | 135 +++++ .../Models/BlobStorageClassTypeProperties.cs | 52 ++ .../Generated/Models/DataResilienceTier.cs | 51 ++ .../src/Generated/Models/FailoverTier.cs | 57 ++ .../LoadBalancerListResult.Serialization.cs | 144 +++++ .../Models/LoadBalancerListResult.cs | 80 +++ ...torageClassTypeProperties.Serialization.cs | 119 ++++ .../NativeStorageClassTypeProperties.cs | 30 + .../NfsDirectoryActionOnVolumeDeletion.cs | 51 ++ ...torageClassTypeProperties.Serialization.cs | 179 ++++++ .../Models/NfsStorageClassTypeProperties.cs | 64 +++ .../src/Generated/Models/PerformanceTier.cs | 60 ++ .../src/Generated/Models/ProvisioningState.cs | 66 +++ ...torageClassTypeProperties.Serialization.cs | 127 +++++ .../Models/RwxStorageClassTypeProperties.cs | 45 ++ .../src/Generated/Models/SCType.cs | 60 ++ ...ServiceResourceListResult.Serialization.cs | 144 +++++ .../Models/ServiceResourceListResult.cs | 80 +++ ...torageClassTypeProperties.Serialization.cs | 178 ++++++ .../Models/SmbStorageClassTypeProperties.cs | 61 ++ ...rageClassPropertiesUpdate.Serialization.cs | 286 ++++++++++ .../Models/StorageClassPropertiesUpdate.cs | 100 ++++ ...geClassResourceListResult.Serialization.cs | 144 +++++ .../Models/StorageClassResourceListResult.cs | 80 +++ ...StorageClassResourcePatch.Serialization.cs | 126 +++++ .../Models/StorageClassResourcePatch.cs | 65 +++ ...torageClassTypeProperties.Serialization.cs | 114 ++++ .../Models/StorageClassTypeProperties.cs | 69 +++ ...ClassTypePropertiesUpdate.Serialization.cs | 260 +++++++++ .../StorageClassTypePropertiesUpdate.cs | 109 ++++ ...torageClassTypeProperties.Serialization.cs | 119 ++++ .../UnknownStorageClassTypeProperties.cs | 29 + .../src/Generated/Models/VolumeBindingMode.cs | 51 ++ .../src/Generated/Models/VolumeExpansion.cs | 51 ++ .../src/Generated/ProviderConstants.cs | 16 + .../RestOperations/BgpPeersRestOperations.cs | 437 +++++++++++++++ .../LoadBalancersRestOperations.cs | 437 +++++++++++++++ .../RestOperations/ServicesRestOperations.cs | 447 +++++++++++++++ .../StorageClassRestOperations.cs | 521 ++++++++++++++++++ .../ServiceResource.Serialization.cs | 26 + .../src/Generated/ServiceResource.cs | 353 ++++++++++++ .../Generated/ServiceResourceCollection.cs | 487 ++++++++++++++++ .../ServiceResourceData.Serialization.cs | 209 +++++++ .../src/Generated/ServiceResourceData.cs | 79 +++ .../StorageClassResource.Serialization.cs | 26 + .../src/Generated/StorageClassResource.cs | 346 ++++++++++++ .../StorageClassResourceCollection.cs | 483 ++++++++++++++++ .../StorageClassResourceData.Serialization.cs | 399 ++++++++++++++ .../src/Generated/StorageClassResourceData.cs | 130 +++++ .../src/Properties/AssemblyInfo.cs | 9 + .../src/autorest.md | 57 ++ ....ContainerOrchestratorRuntime.Tests.csproj | 5 + ...erOrchestratorRuntimeManagementTestBase.cs | 43 ++ ...stratorRuntimeManagementTestEnvironment.cs | 11 + sdk/containerorchestratorruntime/ci.mgmt.yml | 23 + sdk/healthdataaiservices/ci.mgmt.yml | 13 +- sdk/resourcemanager/ci.mgmt.yml | 2 + 100 files changed, 14359 insertions(+), 7 deletions(-) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/Azure.ResourceManager.ContainerOrchestratorRuntime.sln create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/Directory.Build.props create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Azure.ResourceManager.ContainerOrchestratorRuntime.Samples.csproj create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerCollection.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerResource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerCollection.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerResource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResourceCollection.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResourceCollection.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Azure.ResourceManager.ContainerOrchestratorRuntime.csproj create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerCollection.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/Argument.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/Optional.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerCollection.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/BgpPeerOperationSource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ContainerOrchestratorRuntimeArmOperation.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ContainerOrchestratorRuntimeArmOperationOfT.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/LoadBalancerOperationSource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/StorageClassResourceOperationSource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AccessMode.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/DataResilienceTier.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/FailoverTier.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsDirectoryActionOnVolumeDeletion.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/PerformanceTier.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SCType.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeBindingMode.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeExpansion.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ProviderConstants.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceCollection.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceCollection.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Properties/AssemblyInfo.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.csproj create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestBase.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestEnvironment.cs create mode 100644 sdk/containerorchestratorruntime/ci.mgmt.yml diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/Azure.ResourceManager.ContainerOrchestratorRuntime.sln b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/Azure.ResourceManager.ContainerOrchestratorRuntime.sln new file mode 100644 index 0000000000000..ab24f4d23558a --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/Azure.ResourceManager.ContainerOrchestratorRuntime.sln @@ -0,0 +1,65 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30309.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9F6E69E7-B27E-43EA-AC7D-D33ACA837984}") = "Azure.ResourceManager.ContainerOrchestratorRuntime", "src\Azure.ResourceManager.ContainerOrchestratorRuntime.csproj", "{0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}" +EndProject +Project("{9F6E69E7-B27E-43EA-AC7D-D33ACA837984}") = "Azure.ResourceManager.ContainerOrchestratorRuntime.Tests", "tests\Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.csproj", "{C0214FC2-88F7-400E-B1EA-DB294F675623}" +EndProject +Project("{9F6E69E7-B27E-43EA-AC7D-D33ACA837984}") = "Azure.ResourceManager.ContainerOrchestratorRuntime.Samples", "samples\Azure.ResourceManager.ContainerOrchestratorRuntime.Samples.csproj", "{ED2FB799-83E0-4781-A91E-064B30DC641B}" +EndProject +Global + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {60D44954-F0BF-41F4-AA5B-D89A885131B0} + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Debug|x64.ActiveCfg = Debug|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Debug|x64.Build.0 = Debug|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Debug|x86.ActiveCfg = Debug|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Debug|x86.Build.0 = Debug|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Release|Any CPU.Build.0 = Release|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Release|x64.ActiveCfg = Release|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Release|x64.Build.0 = Release|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Release|x86.ActiveCfg = Release|Any CPU + {0AA87EFC-F071-4EF8-AD4A-7BA7E2BF197B}.Release|x86.Build.0 = Release|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Debug|x64.ActiveCfg = Debug|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Debug|x64.Build.0 = Debug|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Debug|x86.ActiveCfg = Debug|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Debug|x86.Build.0 = Debug|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Release|Any CPU.Build.0 = Release|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Release|x64.ActiveCfg = Release|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Release|x64.Build.0 = Release|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Release|x86.ActiveCfg = Release|Any CPU + {C0214FC2-88F7-400E-B1EA-DB294F675623}.Release|x86.Build.0 = Release|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Debug|x64.ActiveCfg = Debug|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Debug|x64.Build.0 = Debug|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Debug|x86.ActiveCfg = Debug|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Debug|x86.Build.0 = Debug|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Release|Any CPU.Build.0 = Release|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Release|x64.ActiveCfg = Release|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Release|x64.Build.0 = Release|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Release|x86.ActiveCfg = Release|Any CPU + {ED2FB799-83E0-4781-A91E-064B30DC641B}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md new file mode 100644 index 0000000000000..6a9f3bac33c1d --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md @@ -0,0 +1,17 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/Directory.Build.props b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/Directory.Build.props new file mode 100644 index 0000000000000..1a9611bd49242 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md new file mode 100644 index 0000000000000..8a3e385664afd --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure ContainerOrchestratorRuntime management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure ContainerOrchestratorRuntime management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.ContainerOrchestratorRuntime --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json new file mode 100644 index 0000000000000..83ab1e134a249 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net//Azure.ResourceManager.ContainerOrchestratorRuntime", + "Tag": "" +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Azure.ResourceManager.ContainerOrchestratorRuntime.Samples.csproj b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Azure.ResourceManager.ContainerOrchestratorRuntime.Samples.csproj new file mode 100644 index 0000000000000..63ad3e13ada60 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Azure.ResourceManager.ContainerOrchestratorRuntime.Samples.csproj @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerCollection.cs new file mode 100644 index 0000000000000..1c271bc10d6b8 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerCollection.cs @@ -0,0 +1,190 @@ +// 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.ContainerOrchestratorRuntime.Samples +{ + public partial class Sample_BgpPeerCollection + { + // BgpPeers_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_BgpPeersList() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_List.json + // this example is just showing the usage of "BgpPeers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this BgpPeerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + BgpPeerCollection collection = client.GetBgpPeers(scopeId); + + // invoke the operation and iterate over the result + await foreach (BgpPeerResource 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 + BgpPeerData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // BgpPeers_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_BgpPeersGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Get.json + // this example is just showing the usage of "BgpPeers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this BgpPeerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + BgpPeerCollection collection = client.GetBgpPeers(scopeId); + + // invoke the operation + string bgpPeerName = "testpeer"; + BgpPeerResource result = await collection.GetAsync(bgpPeerName); + + // 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 + BgpPeerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // BgpPeers_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_BgpPeersGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Get.json + // this example is just showing the usage of "BgpPeers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this BgpPeerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + BgpPeerCollection collection = client.GetBgpPeers(scopeId); + + // invoke the operation + string bgpPeerName = "testpeer"; + bool result = await collection.ExistsAsync(bgpPeerName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // BgpPeers_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_BgpPeersGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Get.json + // this example is just showing the usage of "BgpPeers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this BgpPeerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + BgpPeerCollection collection = client.GetBgpPeers(scopeId); + + // invoke the operation + string bgpPeerName = "testpeer"; + NullableResponse response = await collection.GetIfExistsAsync(bgpPeerName); + BgpPeerResource 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 + BgpPeerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // BgpPeers_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_BgpPeersCreateOrUpdate() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_CreateOrUpdate.json + // this example is just showing the usage of "BgpPeers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this BgpPeerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + BgpPeerCollection collection = client.GetBgpPeers(scopeId); + + // invoke the operation + string bgpPeerName = "testpeer"; + BgpPeerData data = new BgpPeerData() + { + MyAsn = 64500, + PeerAsn = 64501, + PeerAddress = "10.0.0.1", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, bgpPeerName, data); + BgpPeerResource 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 + BgpPeerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerResource.cs new file mode 100644 index 0000000000000..a05d6b7dc69bc --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerResource.cs @@ -0,0 +1,110 @@ +// 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.ContainerOrchestratorRuntime.Samples +{ + public partial class Sample_BgpPeerResource + { + // BgpPeers_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_BgpPeersGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Get.json + // this example is just showing the usage of "BgpPeers_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 BgpPeerResource created on azure + // for more information of creating BgpPeerResource, please refer to the document of BgpPeerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string bgpPeerName = "testpeer"; + ResourceIdentifier bgpPeerResourceId = BgpPeerResource.CreateResourceIdentifier(resourceUri, bgpPeerName); + BgpPeerResource bgpPeer = client.GetBgpPeerResource(bgpPeerResourceId); + + // invoke the operation + BgpPeerResource result = await bgpPeer.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 + BgpPeerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // BgpPeers_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_BgpPeersCreateOrUpdate() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_CreateOrUpdate.json + // this example is just showing the usage of "BgpPeers_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 BgpPeerResource created on azure + // for more information of creating BgpPeerResource, please refer to the document of BgpPeerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string bgpPeerName = "testpeer"; + ResourceIdentifier bgpPeerResourceId = BgpPeerResource.CreateResourceIdentifier(resourceUri, bgpPeerName); + BgpPeerResource bgpPeer = client.GetBgpPeerResource(bgpPeerResourceId); + + // invoke the operation + BgpPeerData data = new BgpPeerData() + { + MyAsn = 64500, + PeerAsn = 64501, + PeerAddress = "10.0.0.1", + }; + ArmOperation lro = await bgpPeer.UpdateAsync(WaitUntil.Completed, data); + BgpPeerResource 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 + BgpPeerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // BgpPeers_Delete + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_BgpPeersDelete() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Delete.json + // this example is just showing the usage of "BgpPeers_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 BgpPeerResource created on azure + // for more information of creating BgpPeerResource, please refer to the document of BgpPeerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string bgpPeerName = "testpeer"; + ResourceIdentifier bgpPeerResourceId = BgpPeerResource.CreateResourceIdentifier(resourceUri, bgpPeerName); + BgpPeerResource bgpPeer = client.GetBgpPeerResource(bgpPeerResourceId); + + // invoke the operation + await bgpPeer.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerCollection.cs new file mode 100644 index 0000000000000..55c63ff242157 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerCollection.cs @@ -0,0 +1,197 @@ +// 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.ContainerOrchestratorRuntime.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples +{ + public partial class Sample_LoadBalancerCollection + { + // LoadBalancers_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_LoadBalancersList() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_List.json + // this example is just showing the usage of "LoadBalancers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this LoadBalancerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + + // invoke the operation and iterate over the result + await foreach (LoadBalancerResource 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 + LoadBalancerData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // LoadBalancers_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_LoadBalancersGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Get.json + // this example is just showing the usage of "LoadBalancers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this LoadBalancerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + + // invoke the operation + string loadBalancerName = "testlb"; + LoadBalancerResource result = await collection.GetAsync(loadBalancerName); + + // 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 + LoadBalancerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // LoadBalancers_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_LoadBalancersGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Get.json + // this example is just showing the usage of "LoadBalancers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this LoadBalancerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + + // invoke the operation + string loadBalancerName = "testlb"; + bool result = await collection.ExistsAsync(loadBalancerName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // LoadBalancers_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_LoadBalancersGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Get.json + // this example is just showing the usage of "LoadBalancers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this LoadBalancerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + + // invoke the operation + string loadBalancerName = "testlb"; + NullableResponse response = await collection.GetIfExistsAsync(loadBalancerName); + LoadBalancerResource 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 + LoadBalancerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // LoadBalancers_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_LoadBalancersCreateOrUpdate() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_CreateOrUpdate.json + // this example is just showing the usage of "LoadBalancers_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this LoadBalancerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + + // invoke the operation + string loadBalancerName = "testlb"; + LoadBalancerData data = new LoadBalancerData() + { + Addresses = +{ +"192.168.50.1/24","192.168.51.2-192.168.51.10" +}, + ServiceSelector = +{ +["app"] = "frontend", +}, + AdvertiseMode = AdvertiseMode.ARP, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data); + LoadBalancerResource 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 + LoadBalancerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerResource.cs new file mode 100644 index 0000000000000..6967eefbd7267 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerResource.cs @@ -0,0 +1,117 @@ +// 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.ContainerOrchestratorRuntime.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples +{ + public partial class Sample_LoadBalancerResource + { + // LoadBalancers_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_LoadBalancersGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Get.json + // this example is just showing the usage of "LoadBalancers_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 LoadBalancerResource created on azure + // for more information of creating LoadBalancerResource, please refer to the document of LoadBalancerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string loadBalancerName = "testlb"; + ResourceIdentifier loadBalancerResourceId = LoadBalancerResource.CreateResourceIdentifier(resourceUri, loadBalancerName); + LoadBalancerResource loadBalancer = client.GetLoadBalancerResource(loadBalancerResourceId); + + // invoke the operation + LoadBalancerResource result = await loadBalancer.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 + LoadBalancerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // LoadBalancers_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_LoadBalancersCreateOrUpdate() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_CreateOrUpdate.json + // this example is just showing the usage of "LoadBalancers_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 LoadBalancerResource created on azure + // for more information of creating LoadBalancerResource, please refer to the document of LoadBalancerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string loadBalancerName = "testlb"; + ResourceIdentifier loadBalancerResourceId = LoadBalancerResource.CreateResourceIdentifier(resourceUri, loadBalancerName); + LoadBalancerResource loadBalancer = client.GetLoadBalancerResource(loadBalancerResourceId); + + // invoke the operation + LoadBalancerData data = new LoadBalancerData() + { + Addresses = +{ +"192.168.50.1/24","192.168.51.2-192.168.51.10" +}, + ServiceSelector = +{ +["app"] = "frontend", +}, + AdvertiseMode = AdvertiseMode.ARP, + }; + ArmOperation lro = await loadBalancer.UpdateAsync(WaitUntil.Completed, data); + LoadBalancerResource 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 + LoadBalancerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // LoadBalancers_Delete + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_LoadBalancersDelete() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Delete.json + // this example is just showing the usage of "LoadBalancers_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 LoadBalancerResource created on azure + // for more information of creating LoadBalancerResource, please refer to the document of LoadBalancerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string loadBalancerName = "testlb"; + ResourceIdentifier loadBalancerResourceId = LoadBalancerResource.CreateResourceIdentifier(resourceUri, loadBalancerName); + LoadBalancerResource loadBalancer = client.GetLoadBalancerResource(loadBalancerResourceId); + + // invoke the operation + await loadBalancer.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResource.cs new file mode 100644 index 0000000000000..8672ad2dda2c5 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResource.cs @@ -0,0 +1,105 @@ +// 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.ContainerOrchestratorRuntime.Samples +{ + public partial class Sample_ServiceResource + { + // Services_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_ServicesGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Get.json + // this example is just showing the usage of "Services_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 ServiceResource created on azure + // for more information of creating ServiceResource, please refer to the document of ServiceResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string serviceName = "storageclass"; + ResourceIdentifier serviceResourceId = ServiceResource.CreateResourceIdentifier(resourceUri, serviceName); + ServiceResource serviceResource = client.GetServiceResource(serviceResourceId); + + // invoke the operation + ServiceResource result = await serviceResource.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 + ServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Services_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_ServicesCreateOrUpdate() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_CreateOrUpdate.json + // this example is just showing the usage of "Services_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 ServiceResource created on azure + // for more information of creating ServiceResource, please refer to the document of ServiceResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string serviceName = "storageclass"; + ResourceIdentifier serviceResourceId = ServiceResource.CreateResourceIdentifier(resourceUri, serviceName); + ServiceResource serviceResource = client.GetServiceResource(serviceResourceId); + + // invoke the operation + ServiceResourceData data = new ServiceResourceData(); + ArmOperation lro = await serviceResource.UpdateAsync(WaitUntil.Completed, data); + ServiceResource 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 + ServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Services_Delete + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_ServicesDelete() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Delete.json + // this example is just showing the usage of "Services_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 ServiceResource created on azure + // for more information of creating ServiceResource, please refer to the document of ServiceResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string serviceName = "storageclass"; + ResourceIdentifier serviceResourceId = ServiceResource.CreateResourceIdentifier(resourceUri, serviceName); + ServiceResource serviceResource = client.GetServiceResource(serviceResourceId); + + // invoke the operation + await serviceResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResourceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResourceCollection.cs new file mode 100644 index 0000000000000..ccf9d7cd5a38b --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResourceCollection.cs @@ -0,0 +1,185 @@ +// 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.ContainerOrchestratorRuntime.Samples +{ + public partial class Sample_ServiceResourceCollection + { + // Services_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ServicesList() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_List.json + // this example is just showing the usage of "Services_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this ServiceResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + ServiceResourceCollection collection = client.GetServiceResources(scopeId); + + // invoke the operation and iterate over the result + await foreach (ServiceResource 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 + ServiceResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Services_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_ServicesGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Get.json + // this example is just showing the usage of "Services_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this ServiceResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + ServiceResourceCollection collection = client.GetServiceResources(scopeId); + + // invoke the operation + string serviceName = "storageclass"; + ServiceResource result = await collection.GetAsync(serviceName); + + // 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 + ServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Services_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_ServicesGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Get.json + // this example is just showing the usage of "Services_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this ServiceResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + ServiceResourceCollection collection = client.GetServiceResources(scopeId); + + // invoke the operation + string serviceName = "storageclass"; + bool result = await collection.ExistsAsync(serviceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Services_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_ServicesGet() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Get.json + // this example is just showing the usage of "Services_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this ServiceResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + ServiceResourceCollection collection = client.GetServiceResources(scopeId); + + // invoke the operation + string serviceName = "storageclass"; + NullableResponse response = await collection.GetIfExistsAsync(serviceName); + ServiceResource 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 + ServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Services_CreateOrUpdate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_ServicesCreateOrUpdate() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_CreateOrUpdate.json + // this example is just showing the usage of "Services_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this ServiceResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + ServiceResourceCollection collection = client.GetServiceResources(scopeId); + + // invoke the operation + string serviceName = "storageclass"; + ServiceResourceData data = new ServiceResourceData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data); + ServiceResource 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 + ServiceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResource.cs new file mode 100644 index 0000000000000..7e638590ea1a6 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResource.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.ContainerOrchestratorRuntime.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples +{ + public partial class Sample_StorageClassResource + { + // StorageClass_Get_0 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_StorageClassGet0() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Get.json + // this example is just showing the usage of "StorageClass_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 StorageClassResource created on azure + // for more information of creating StorageClassResource, please refer to the document of StorageClassResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string storageClassName = "testrwx"; + ResourceIdentifier storageClassResourceId = StorageClassResource.CreateResourceIdentifier(resourceUri, storageClassName); + StorageClassResource storageClassResource = client.GetStorageClassResource(storageClassResourceId); + + // invoke the operation + StorageClassResource result = await storageClassResource.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 + StorageClassResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // StorageClass_Update_0 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_StorageClassUpdate0() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Update.json + // this example is just showing the usage of "StorageClass_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 StorageClassResource created on azure + // for more information of creating StorageClassResource, please refer to the document of StorageClassResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string storageClassName = "testrwx"; + ResourceIdentifier storageClassResourceId = StorageClassResource.CreateResourceIdentifier(resourceUri, storageClassName); + StorageClassResource storageClassResource = client.GetStorageClassResource(storageClassResourceId); + + // invoke the operation + StorageClassResourcePatch patch = new StorageClassResourcePatch() + { + Properties = new StorageClassPropertiesUpdate() + { + TypeProperties = new StorageClassTypePropertiesUpdate() + { + BackingStorageClassName = "default", + }, + }, + }; + ArmOperation lro = await storageClassResource.UpdateAsync(WaitUntil.Completed, patch); + StorageClassResource 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 + StorageClassResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // StorageClass_Delete_0 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_StorageClassDelete0() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Delete.json + // this example is just showing the usage of "StorageClass_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 StorageClassResource created on azure + // for more information of creating StorageClassResource, please refer to the document of StorageClassResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + string storageClassName = "testrwx"; + ResourceIdentifier storageClassResourceId = StorageClassResource.CreateResourceIdentifier(resourceUri, storageClassName); + StorageClassResource storageClassResource = client.GetStorageClassResource(storageClassResourceId); + + // invoke the operation + await storageClassResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResourceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResourceCollection.cs new file mode 100644 index 0000000000000..e0fc7961680e6 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResourceCollection.cs @@ -0,0 +1,189 @@ +// 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.ContainerOrchestratorRuntime.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples +{ + public partial class Sample_StorageClassResourceCollection + { + // StorageClass_List_0 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_StorageClassList0() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_List.json + // this example is just showing the usage of "StorageClass_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this StorageClassResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + + // invoke the operation and iterate over the result + await foreach (StorageClassResource 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 + StorageClassResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // StorageClass_Get_0 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_StorageClassGet0() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Get.json + // this example is just showing the usage of "StorageClass_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this StorageClassResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + + // invoke the operation + string storageClassName = "testrwx"; + StorageClassResource result = await collection.GetAsync(storageClassName); + + // 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 + StorageClassResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // StorageClass_Get_0 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_StorageClassGet0() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Get.json + // this example is just showing the usage of "StorageClass_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this StorageClassResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + + // invoke the operation + string storageClassName = "testrwx"; + bool result = await collection.ExistsAsync(storageClassName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // StorageClass_Get_0 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_StorageClassGet0() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Get.json + // this example is just showing the usage of "StorageClass_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this StorageClassResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + + // invoke the operation + string storageClassName = "testrwx"; + NullableResponse response = await collection.GetIfExistsAsync(storageClassName); + StorageClassResource 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 + StorageClassResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // StorageClass_CreateOrUpdate_0 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_StorageClassCreateOrUpdate0() + { + // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_CreateOrUpdate.json + // this example is just showing the usage of "StorageClass_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this StorageClassResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + + // invoke the operation + string storageClassName = "testrwx"; + StorageClassResourceData data = new StorageClassResourceData() + { + TypeProperties = new RwxStorageClassTypeProperties("default"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, storageClassName, data); + StorageClassResource 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 + StorageClassResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Azure.ResourceManager.ContainerOrchestratorRuntime.csproj b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Azure.ResourceManager.ContainerOrchestratorRuntime.csproj new file mode 100644 index 0000000000000..c81b22d836784 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Azure.ResourceManager.ContainerOrchestratorRuntime.csproj @@ -0,0 +1,8 @@ + + + 1.0.0-beta.1 + Azure.ResourceManager.ContainerOrchestratorRuntime + Azure Resource Manager client SDK for Azure resource provider ContainerOrchestratorRuntime. + azure;management;arm;resource manager;containerorchestratorruntime + + diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs new file mode 100644 index 0000000000000..d2664b30532c5 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs @@ -0,0 +1,141 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + /// Model factory for models. + public static partial class ArmContainerOrchestratorRuntimeModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// My ASN. + /// Peer ASN. + /// Peer Address. + /// Resource provision state. + /// A new instance for mocking. + public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? myAsn = null, int? peerAsn = null, string peerAddress = null, ProvisioningState? provisioningState = null) + { + return new BgpPeerData( + id, + name, + resourceType, + systemData, + myAsn, + peerAsn, + peerAddress, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// IP Range. + /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label "a=b", then please specify {"a": "b"} in the field. + /// Advertise Mode. + /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. + /// Resource provision state. + /// A new instance for mocking. + public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable addresses = null, IDictionary serviceSelector = null, AdvertiseMode? advertiseMode = null, IEnumerable bgpPeers = null, ProvisioningState? provisioningState = null) + { + addresses ??= new List(); + serviceSelector ??= new Dictionary(); + bgpPeers ??= new List(); + + return new LoadBalancerData( + id, + name, + resourceType, + systemData, + addresses?.ToList(), + serviceSelector, + advertiseMode, + bgpPeers?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The object id of the service principal of the RP provisioned in the tenant. + /// Resource provision state. + /// A new instance for mocking. + public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string rpObjectId = null, ProvisioningState? provisioningState = null) + { + return new ServiceResourceData( + id, + name, + resourceType, + systemData, + rpObjectId, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Volume can be expanded or not. + /// Additional mount options. + /// Provisioner name. + /// Binding mode of volumes: Immediate, WaitForFirstConsumer. + /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. + /// Allow single data node failure. + /// Failover speed: NA, Slow, Fast. + /// Limitations of the storage class. + /// Performance tier. + /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. + /// + /// Properties of the StorageClass + /// 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 , , , and . + /// + /// Resource provision state. + /// A new instance for mocking. + public static StorageClassResourceData StorageClassResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeExpansion? allowVolumeExpansion = null, IEnumerable mountOptions = null, string provisioner = null, VolumeBindingMode? volumeBindingMode = null, IEnumerable accessModes = null, DataResilienceTier? dataResilience = null, FailoverTier? failoverSpeed = null, IEnumerable limitations = null, PerformanceTier? performance = null, long? priority = null, StorageClassTypeProperties typeProperties = null, ProvisioningState? provisioningState = null) + { + mountOptions ??= new List(); + accessModes ??= new List(); + limitations ??= new List(); + + return new StorageClassResourceData( + id, + name, + resourceType, + systemData, + allowVolumeExpansion, + mountOptions?.ToList(), + provisioner, + volumeBindingMode, + accessModes?.ToList(), + dataResilience, + failoverSpeed, + limitations?.ToList(), + performance, + priority, + typeProperties, + provisioningState, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerCollection.cs new file mode 100644 index 0000000000000..1c5ef4ebb0903 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerCollection.cs @@ -0,0 +1,483 @@ +// 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.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// 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 GetBgpPeers method from an instance of . + /// + public partial class BgpPeerCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _bgpPeerClientDiagnostics; + private readonly BgpPeersRestOperations _bgpPeerRestClient; + + /// Initializes a new instance of the class for mocking. + protected BgpPeerCollection() + { + } + + /// 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 BgpPeerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _bgpPeerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", BgpPeerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BgpPeerResource.ResourceType, out string bgpPeerApiVersion); + _bgpPeerRestClient = new BgpPeersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, bgpPeerApiVersion); + } + + /// + /// Create a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the BgpPeer. + /// 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 bgpPeerName, BgpPeerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _bgpPeerRestClient.CreateOrUpdateAsync(Id, bgpPeerName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new BgpPeerOperationSource(Client), _bgpPeerClientDiagnostics, Pipeline, _bgpPeerRestClient.CreateCreateOrUpdateRequest(Id, bgpPeerName, 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 BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the BgpPeer. + /// 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 bgpPeerName, BgpPeerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _bgpPeerRestClient.CreateOrUpdate(Id, bgpPeerName, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new BgpPeerOperationSource(Client), _bgpPeerClientDiagnostics, Pipeline, _bgpPeerRestClient.CreateCreateOrUpdateRequest(Id, bgpPeerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the BgpPeer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.Get"); + scope.Start(); + try + { + var response = await _bgpPeerRestClient.GetAsync(Id, bgpPeerName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the BgpPeer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.Get"); + scope.Start(); + try + { + var response = _bgpPeerRestClient.Get(Id, bgpPeerName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BgpPeer resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers + /// + /// + /// Operation Id + /// BgpPeers_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _bgpPeerRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _bgpPeerRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BgpPeerResource(Client, BgpPeerData.DeserializeBgpPeerData(e)), _bgpPeerClientDiagnostics, Pipeline, "BgpPeerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BgpPeer resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers + /// + /// + /// Operation Id + /// BgpPeers_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _bgpPeerRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _bgpPeerRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BgpPeerResource(Client, BgpPeerData.DeserializeBgpPeerData(e)), _bgpPeerClientDiagnostics, Pipeline, "BgpPeerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the BgpPeer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.Exists"); + scope.Start(); + try + { + var response = await _bgpPeerRestClient.GetAsync(Id, bgpPeerName, 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 + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the BgpPeer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.Exists"); + scope.Start(); + try + { + var response = _bgpPeerRestClient.Get(Id, bgpPeerName, 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 + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the BgpPeer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _bgpPeerRestClient.GetAsync(Id, bgpPeerName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the BgpPeer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.GetIfExists"); + scope.Start(); + try + { + var response = _bgpPeerRestClient.Get(Id, bgpPeerName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BgpPeerResource(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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs new file mode 100644 index 0000000000000..582a731f0fc0c --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs @@ -0,0 +1,241 @@ +// 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.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + public partial class BgpPeerData : 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(BgpPeerData)} 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(MyAsn)) + { + writer.WritePropertyName("myAsn"u8); + writer.WriteNumberValue(MyAsn.Value); + } + if (Optional.IsDefined(PeerAsn)) + { + writer.WritePropertyName("peerAsn"u8); + writer.WriteNumberValue(PeerAsn.Value); + } + if (Optional.IsDefined(PeerAddress)) + { + writer.WritePropertyName("peerAddress"u8); + writer.WriteStringValue(PeerAddress); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + 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(); + } + + BgpPeerData 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(BgpPeerData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBgpPeerData(document.RootElement, options); + } + + internal static BgpPeerData DeserializeBgpPeerData(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? myAsn = default; + int? peerAsn = default; + string peerAddress = default; + ProvisioningState? provisioningState = 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("myAsn"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + myAsn = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("peerAsn"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peerAsn = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("peerAddress"u8)) + { + peerAddress = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BgpPeerData( + id, + name, + type, + systemData, + myAsn, + peerAsn, + peerAddress, + 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(BgpPeerData)} does not support writing '{options.Format}' format."); + } + } + + BgpPeerData 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 DeserializeBgpPeerData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BgpPeerData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs new file mode 100644 index 0000000000000..797d8499915d0 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.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.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// A class representing the BgpPeer data model. + /// A BgpPeer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) + /// + public partial class BgpPeerData : 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 BgpPeerData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// My ASN. + /// Peer ASN. + /// Peer Address. + /// Resource provision state. + /// Keeps track of any properties unknown to the library. + internal BgpPeerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? myAsn, int? peerAsn, string peerAddress, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + MyAsn = myAsn; + PeerAsn = peerAsn; + PeerAddress = peerAddress; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// My ASN. + public int? MyAsn { get; set; } + /// Peer ASN. + public int? PeerAsn { get; set; } + /// Peer Address. + public string PeerAddress { get; set; } + /// Resource provision state. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.Serialization.cs new file mode 100644 index 0000000000000..ed0d744d4b48f --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.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.ContainerOrchestratorRuntime +{ + public partial class BgpPeerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + BgpPeerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + BgpPeerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.cs new file mode 100644 index 0000000000000..ee0eb41dcfd44 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.cs @@ -0,0 +1,349 @@ +// 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.ContainerOrchestratorRuntime +{ + /// + /// A Class representing a BgpPeer 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 GetBgpPeerResource method. + /// Otherwise you can get one from its parent resource using the GetBgpPeer method. + /// + public partial class BgpPeerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The resourceUri. + /// The bgpPeerName. + public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string bgpPeerName) + { + var resourceId = $"{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _bgpPeerClientDiagnostics; + private readonly BgpPeersRestOperations _bgpPeerRestClient; + private readonly BgpPeerData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.KubernetesRuntime/bgpPeers"; + + /// Initializes a new instance of the class for mocking. + protected BgpPeerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal BgpPeerResource(ArmClient client, BgpPeerData 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 BgpPeerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _bgpPeerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string bgpPeerApiVersion); + _bgpPeerRestClient = new BgpPeersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, bgpPeerApiVersion); +#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 BgpPeerData 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 BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Get"); + scope.Start(); + try + { + var response = await _bgpPeerRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Get"); + scope.Start(); + try + { + var response = _bgpPeerRestClient.Get(Id.Parent, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Delete"); + scope.Start(); + try + { + var response = await _bgpPeerRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _bgpPeerRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Delete"); + scope.Start(); + try + { + var response = _bgpPeerRestClient.Delete(Id.Parent, Id.Name, cancellationToken); + var uri = _bgpPeerRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, BgpPeerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Update"); + scope.Start(); + try + { + var response = await _bgpPeerRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new BgpPeerOperationSource(Client), _bgpPeerClientDiagnostics, Pipeline, _bgpPeerRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, 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 BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, BgpPeerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Update"); + scope.Start(); + try + { + var response = _bgpPeerRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new BgpPeerOperationSource(Client), _bgpPeerClientDiagnostics, Pipeline, _bgpPeerRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs new file mode 100644 index 0000000000000..cc217efe8192b --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs @@ -0,0 +1,484 @@ +// 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.ContainerOrchestratorRuntime.Mocking; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// A class to add extension methods to Azure.ResourceManager.ContainerOrchestratorRuntime. + public static partial class ContainerOrchestratorRuntimeExtensions + { + private static MockableContainerOrchestratorRuntimeArmClient GetMockableContainerOrchestratorRuntimeArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableContainerOrchestratorRuntimeArmClient(client0)); + } + + /// + /// Gets a collection of BgpPeerResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// is null. + /// An object representing collection of BgpPeerResources and their operations over a BgpPeerResource. + public static BgpPeerCollection GetBgpPeers(this ArmClient client, ResourceIdentifier scope) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetBgpPeers(scope); + } + + /// + /// Get a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of the BgpPeer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetBgpPeerAsync(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetBgpPeerAsync(scope, bgpPeerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of the BgpPeer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetBgpPeer(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetBgpPeer(scope, bgpPeerName, cancellationToken); + } + + /// + /// Gets a collection of LoadBalancerResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// is null. + /// An object representing collection of LoadBalancerResources and their operations over a LoadBalancerResource. + public static LoadBalancerCollection GetLoadBalancers(this ArmClient client, ResourceIdentifier scope) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetLoadBalancers(scope); + } + + /// + /// Get a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetLoadBalancerAsync(this ArmClient client, ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetLoadBalancerAsync(scope, loadBalancerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetLoadBalancer(this ArmClient client, ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetLoadBalancer(scope, loadBalancerName, cancellationToken); + } + + /// + /// Gets a collection of ServiceResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// is null. + /// An object representing collection of ServiceResources and their operations over a ServiceResource. + public static ServiceResourceCollection GetServiceResources(this ArmClient client, ResourceIdentifier scope) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetServiceResources(scope); + } + + /// + /// Get a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of the the service. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetServiceResourceAsync(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetServiceResourceAsync(scope, serviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of the the service. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetServiceResource(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetServiceResource(scope, serviceName, cancellationToken); + } + + /// + /// Gets a collection of StorageClassResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// is null. + /// An object representing collection of StorageClassResources and their operations over a StorageClassResource. + public static StorageClassResourceCollection GetStorageClassResources(this ArmClient client, ResourceIdentifier scope) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetStorageClassResources(scope); + } + + /// + /// Get a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of the the storage class. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetStorageClassResourceAsync(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetStorageClassResourceAsync(scope, storageClassName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The name of the the storage class. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetStorageClassResource(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetStorageClassResource(scope, storageClassName, cancellationToken); + } + + /// + /// 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 BgpPeerResource GetBgpPeerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetBgpPeerResource(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 LoadBalancerResource GetLoadBalancerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetLoadBalancerResource(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 ServiceResource GetServiceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetServiceResource(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 StorageClassResource GetStorageClassResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetStorageClassResource(id); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs new file mode 100644 index 0000000000000..6fc7e67dc3235 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs @@ -0,0 +1,376 @@ +// 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.ContainerOrchestratorRuntime.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableContainerOrchestratorRuntimeArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableContainerOrchestratorRuntimeArmClient() + { + } + + /// 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 MockableContainerOrchestratorRuntimeArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableContainerOrchestratorRuntimeArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of BgpPeerResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of BgpPeerResources and their operations over a BgpPeerResource. + public virtual BgpPeerCollection GetBgpPeers(ResourceIdentifier scope) + { + return new BgpPeerCollection(Client, scope); + } + + /// + /// Get a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the BgpPeer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBgpPeerAsync(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + { + return await GetBgpPeers(scope).GetAsync(bgpPeerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BgpPeer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// + /// + /// Operation Id + /// BgpPeers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the BgpPeer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBgpPeer(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + { + return GetBgpPeers(scope).Get(bgpPeerName, cancellationToken); + } + + /// Gets a collection of LoadBalancerResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of LoadBalancerResources and their operations over a LoadBalancerResource. + public virtual LoadBalancerCollection GetLoadBalancers(ResourceIdentifier scope) + { + return new LoadBalancerCollection(Client, scope); + } + + /// + /// Get a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLoadBalancerAsync(ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) + { + return await GetLoadBalancers(scope).GetAsync(loadBalancerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLoadBalancer(ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) + { + return GetLoadBalancers(scope).Get(loadBalancerName, cancellationToken); + } + + /// Gets a collection of ServiceResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of ServiceResources and their operations over a ServiceResource. + public virtual ServiceResourceCollection GetServiceResources(ResourceIdentifier scope) + { + return new ServiceResourceCollection(Client, scope); + } + + /// + /// Get a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the the service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServiceResourceAsync(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + { + return await GetServiceResources(scope).GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the the service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServiceResource(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + { + return GetServiceResources(scope).Get(serviceName, cancellationToken); + } + + /// Gets a collection of StorageClassResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of StorageClassResources and their operations over a StorageClassResource. + public virtual StorageClassResourceCollection GetStorageClassResources(ResourceIdentifier scope) + { + return new StorageClassResourceCollection(Client, scope); + } + + /// + /// Get a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the the storage class. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStorageClassResourceAsync(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + { + return await GetStorageClassResources(scope).GetAsync(storageClassName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the the storage class. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStorageClassResource(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + { + return GetStorageClassResources(scope).Get(storageClassName, cancellationToken); + } + + /// + /// 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 BgpPeerResource GetBgpPeerResource(ResourceIdentifier id) + { + BgpPeerResource.ValidateResourceId(id); + return new BgpPeerResource(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 LoadBalancerResource GetLoadBalancerResource(ResourceIdentifier id) + { + LoadBalancerResource.ValidateResourceId(id); + return new LoadBalancerResource(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 ServiceResource GetServiceResource(ResourceIdentifier id) + { + ServiceResource.ValidateResourceId(id); + return new ServiceResource(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 StorageClassResource GetStorageClassResource(ResourceIdentifier id) + { + StorageClassResource.ValidateResourceId(id); + return new StorageClassResource(Client, id); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/Argument.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/Argument.cs new file mode 100644 index 0000000000000..a65d949f1f690 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/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.ContainerOrchestratorRuntime +{ + 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 0000000000000..523aea7871d39 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/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.ContainerOrchestratorRuntime +{ + 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/ChangeTrackingList.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 0000000000000..99ac7574a0dcd --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/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.ContainerOrchestratorRuntime +{ + 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 0000000000000..dada287fbfba2 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/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.ContainerOrchestratorRuntime +{ + 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/Optional.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/Optional.cs new file mode 100644 index 0000000000000..49d47bb50e2ec --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/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.ContainerOrchestratorRuntime +{ + 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 0000000000000..97b1c41080d13 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/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.ContainerOrchestratorRuntime +{ + 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerCollection.cs new file mode 100644 index 0000000000000..d00361ce5e726 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerCollection.cs @@ -0,0 +1,483 @@ +// 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.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// 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 GetLoadBalancers method from an instance of . + /// + public partial class LoadBalancerCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _loadBalancerClientDiagnostics; + private readonly LoadBalancersRestOperations _loadBalancerRestClient; + + /// Initializes a new instance of the class for mocking. + protected LoadBalancerCollection() + { + } + + /// 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 LoadBalancerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _loadBalancerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", LoadBalancerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(LoadBalancerResource.ResourceType, out string loadBalancerApiVersion); + _loadBalancerRestClient = new LoadBalancersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, loadBalancerApiVersion); + } + + /// + /// Create a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the LoadBalancer. + /// 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 loadBalancerName, LoadBalancerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _loadBalancerRestClient.CreateOrUpdateAsync(Id, loadBalancerName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new LoadBalancerOperationSource(Client), _loadBalancerClientDiagnostics, Pipeline, _loadBalancerRestClient.CreateCreateOrUpdateRequest(Id, loadBalancerName, 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 LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the LoadBalancer. + /// 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 loadBalancerName, LoadBalancerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _loadBalancerRestClient.CreateOrUpdate(Id, loadBalancerName, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new LoadBalancerOperationSource(Client), _loadBalancerClientDiagnostics, Pipeline, _loadBalancerRestClient.CreateCreateOrUpdateRequest(Id, loadBalancerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.Get"); + scope.Start(); + try + { + var response = await _loadBalancerRestClient.GetAsync(Id, loadBalancerName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.Get"); + scope.Start(); + try + { + var response = _loadBalancerRestClient.Get(Id, loadBalancerName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List LoadBalancer resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers + /// + /// + /// Operation Id + /// LoadBalancers_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _loadBalancerRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _loadBalancerRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LoadBalancerResource(Client, LoadBalancerData.DeserializeLoadBalancerData(e)), _loadBalancerClientDiagnostics, Pipeline, "LoadBalancerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List LoadBalancer resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers + /// + /// + /// Operation Id + /// LoadBalancers_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _loadBalancerRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _loadBalancerRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LoadBalancerResource(Client, LoadBalancerData.DeserializeLoadBalancerData(e)), _loadBalancerClientDiagnostics, Pipeline, "LoadBalancerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.Exists"); + scope.Start(); + try + { + var response = await _loadBalancerRestClient.GetAsync(Id, loadBalancerName, 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 + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.Exists"); + scope.Start(); + try + { + var response = _loadBalancerRestClient.Get(Id, loadBalancerName, 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 + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _loadBalancerRestClient.GetAsync(Id, loadBalancerName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.GetIfExists"); + scope.Start(); + try + { + var response = _loadBalancerRestClient.Get(Id, loadBalancerName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new LoadBalancerResource(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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs new file mode 100644 index 0000000000000..b1cbe1e95b073 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs @@ -0,0 +1,292 @@ +// 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.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + public partial class LoadBalancerData : 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(LoadBalancerData)} 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(Addresses)) + { + writer.WritePropertyName("addresses"u8); + writer.WriteStartArray(); + foreach (var item in Addresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ServiceSelector)) + { + writer.WritePropertyName("serviceSelector"u8); + writer.WriteStartObject(); + foreach (var item in ServiceSelector) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(AdvertiseMode)) + { + writer.WritePropertyName("advertiseMode"u8); + writer.WriteStringValue(AdvertiseMode.Value.ToString()); + } + if (Optional.IsCollectionDefined(BgpPeers)) + { + writer.WritePropertyName("bgpPeers"u8); + writer.WriteStartArray(); + foreach (var item in BgpPeers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + 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(); + } + + LoadBalancerData 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(LoadBalancerData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLoadBalancerData(document.RootElement, options); + } + + internal static LoadBalancerData DeserializeLoadBalancerData(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; + IList addresses = default; + IDictionary serviceSelector = default; + AdvertiseMode? advertiseMode = default; + IList bgpPeers = default; + ProvisioningState? provisioningState = 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("addresses"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + addresses = array; + continue; + } + if (property0.NameEquals("serviceSelector"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()); + } + serviceSelector = dictionary; + continue; + } + if (property0.NameEquals("advertiseMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + advertiseMode = new AdvertiseMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("bgpPeers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + bgpPeers = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LoadBalancerData( + id, + name, + type, + systemData, + addresses ?? new ChangeTrackingList(), + serviceSelector ?? new ChangeTrackingDictionary(), + advertiseMode, + bgpPeers ?? new ChangeTrackingList(), + 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(LoadBalancerData)} does not support writing '{options.Format}' format."); + } + } + + LoadBalancerData 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 DeserializeLoadBalancerData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LoadBalancerData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs new file mode 100644 index 0000000000000..872e3c47602e3 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs @@ -0,0 +1,94 @@ +// 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.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// A class representing the LoadBalancer data model. + /// A LoadBalancer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) + /// + public partial class LoadBalancerData : 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 LoadBalancerData() + { + Addresses = new ChangeTrackingList(); + ServiceSelector = new ChangeTrackingDictionary(); + BgpPeers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// IP Range. + /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label "a=b", then please specify {"a": "b"} in the field. + /// Advertise Mode. + /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. + /// Resource provision state. + /// Keeps track of any properties unknown to the library. + internal LoadBalancerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList addresses, IDictionary serviceSelector, AdvertiseMode? advertiseMode, IList bgpPeers, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Addresses = addresses; + ServiceSelector = serviceSelector; + AdvertiseMode = advertiseMode; + BgpPeers = bgpPeers; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// IP Range. + public IList Addresses { get; } + /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label "a=b", then please specify {"a": "b"} in the field. + public IDictionary ServiceSelector { get; } + /// Advertise Mode. + public AdvertiseMode? AdvertiseMode { get; set; } + /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. + public IList BgpPeers { get; } + /// Resource provision state. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.Serialization.cs new file mode 100644 index 0000000000000..f1ac936c92484 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.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.ContainerOrchestratorRuntime +{ + public partial class LoadBalancerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + LoadBalancerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + LoadBalancerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.cs new file mode 100644 index 0000000000000..e7ff7234da2e4 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.cs @@ -0,0 +1,349 @@ +// 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.ContainerOrchestratorRuntime +{ + /// + /// A Class representing a LoadBalancer 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 GetLoadBalancerResource method. + /// Otherwise you can get one from its parent resource using the GetLoadBalancer method. + /// + public partial class LoadBalancerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The resourceUri. + /// The loadBalancerName. + public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string loadBalancerName) + { + var resourceId = $"{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _loadBalancerClientDiagnostics; + private readonly LoadBalancersRestOperations _loadBalancerRestClient; + private readonly LoadBalancerData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.KubernetesRuntime/loadBalancers"; + + /// Initializes a new instance of the class for mocking. + protected LoadBalancerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal LoadBalancerResource(ArmClient client, LoadBalancerData 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 LoadBalancerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _loadBalancerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string loadBalancerApiVersion); + _loadBalancerRestClient = new LoadBalancersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, loadBalancerApiVersion); +#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 LoadBalancerData 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 LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Get"); + scope.Start(); + try + { + var response = await _loadBalancerRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Get"); + scope.Start(); + try + { + var response = _loadBalancerRestClient.Get(Id.Parent, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Delete"); + scope.Start(); + try + { + var response = await _loadBalancerRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _loadBalancerRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Delete"); + scope.Start(); + try + { + var response = _loadBalancerRestClient.Delete(Id.Parent, Id.Name, cancellationToken); + var uri = _loadBalancerRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, LoadBalancerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Update"); + scope.Start(); + try + { + var response = await _loadBalancerRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new LoadBalancerOperationSource(Client), _loadBalancerClientDiagnostics, Pipeline, _loadBalancerRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, 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 LoadBalancer + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, LoadBalancerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Update"); + scope.Start(); + try + { + var response = _loadBalancerRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new LoadBalancerOperationSource(Client), _loadBalancerClientDiagnostics, Pipeline, _loadBalancerRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/BgpPeerOperationSource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/BgpPeerOperationSource.cs new file mode 100644 index 0000000000000..dbb06263d6c00 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/BgpPeerOperationSource.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.ContainerOrchestratorRuntime +{ + internal class BgpPeerOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal BgpPeerOperationSource(ArmClient client) + { + _client = client; + } + + BgpPeerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = BgpPeerData.DeserializeBgpPeerData(document.RootElement); + return new BgpPeerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = BgpPeerData.DeserializeBgpPeerData(document.RootElement); + return new BgpPeerResource(_client, data); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ContainerOrchestratorRuntimeArmOperation.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ContainerOrchestratorRuntimeArmOperation.cs new file mode 100644 index 0000000000000..8b06705041167 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ContainerOrchestratorRuntimeArmOperation.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.ContainerOrchestratorRuntime +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ContainerOrchestratorRuntimeArmOperation : 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 ContainerOrchestratorRuntimeArmOperation for mocking. + protected ContainerOrchestratorRuntimeArmOperation() + { + } + + internal ContainerOrchestratorRuntimeArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ContainerOrchestratorRuntimeArmOperation(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, "ContainerOrchestratorRuntimeArmOperation", 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ContainerOrchestratorRuntimeArmOperationOfT.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ContainerOrchestratorRuntimeArmOperationOfT.cs new file mode 100644 index 0000000000000..6caaa91dc6d9f --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ContainerOrchestratorRuntimeArmOperationOfT.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.ContainerOrchestratorRuntime +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ContainerOrchestratorRuntimeArmOperation : 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 ContainerOrchestratorRuntimeArmOperation for mocking. + protected ContainerOrchestratorRuntimeArmOperation() + { + } + + internal ContainerOrchestratorRuntimeArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ContainerOrchestratorRuntimeArmOperation(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, "ContainerOrchestratorRuntimeArmOperation", 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/LoadBalancerOperationSource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/LoadBalancerOperationSource.cs new file mode 100644 index 0000000000000..eb96c1ac7e675 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/LoadBalancerOperationSource.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.ContainerOrchestratorRuntime +{ + internal class LoadBalancerOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal LoadBalancerOperationSource(ArmClient client) + { + _client = client; + } + + LoadBalancerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = LoadBalancerData.DeserializeLoadBalancerData(document.RootElement); + return new LoadBalancerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = LoadBalancerData.DeserializeLoadBalancerData(document.RootElement); + return new LoadBalancerResource(_client, data); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/StorageClassResourceOperationSource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/StorageClassResourceOperationSource.cs new file mode 100644 index 0000000000000..af1496880b3b1 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/StorageClassResourceOperationSource.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.ContainerOrchestratorRuntime +{ + internal class StorageClassResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal StorageClassResourceOperationSource(ArmClient client) + { + _client = client; + } + + StorageClassResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = StorageClassResourceData.DeserializeStorageClassResourceData(document.RootElement); + return new StorageClassResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = StorageClassResourceData.DeserializeStorageClassResourceData(document.RootElement); + return new StorageClassResource(_client, data); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AccessMode.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AccessMode.cs new file mode 100644 index 0000000000000..30fb6cab18cae --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AccessMode.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.ContainerOrchestratorRuntime.Models +{ + /// Storage Class Access Mode. + public readonly partial struct AccessMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccessMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadWriteOnceValue = "ReadWriteOnce"; + private const string ReadWriteManyValue = "ReadWriteMany"; + + /// Read Write Once (RWO) access mode. + public static AccessMode ReadWriteOnce { get; } = new AccessMode(ReadWriteOnceValue); + /// Read Write Many (RWX) access mode. + public static AccessMode ReadWriteMany { get; } = new AccessMode(ReadWriteManyValue); + /// Determines if two values are the same. + public static bool operator ==(AccessMode left, AccessMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccessMode left, AccessMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AccessMode(string value) => new AccessMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccessMode other && Equals(other); + /// + public bool Equals(AccessMode 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs new file mode 100644 index 0000000000000..ad37756bc9354 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.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.ContainerOrchestratorRuntime.Models +{ + /// Enum of advertise mode. + public readonly partial struct AdvertiseMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AdvertiseMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ARPValue = "ARP"; + private const string BGPValue = "BGP"; + private const string BothValue = "Both"; + + /// ARP advertise mode. + public static AdvertiseMode ARP { get; } = new AdvertiseMode(ARPValue); + /// BGP advertise mode. + public static AdvertiseMode BGP { get; } = new AdvertiseMode(BGPValue); + /// both ARP and BGP advertise mode. + public static AdvertiseMode Both { get; } = new AdvertiseMode(BothValue); + /// Determines if two values are the same. + public static bool operator ==(AdvertiseMode left, AdvertiseMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AdvertiseMode left, AdvertiseMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AdvertiseMode(string value) => new AdvertiseMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AdvertiseMode other && Equals(other); + /// + public bool Equals(AdvertiseMode 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.Serialization.cs new file mode 100644 index 0000000000000..9186702afe924 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + internal partial class BgpPeerListResult : 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(BgpPeerListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BgpPeerListResult 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(BgpPeerListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBgpPeerListResult(document.RootElement, options); + } + + internal static BgpPeerListResult DeserializeBgpPeerListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BgpPeerData.DeserializeBgpPeerData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BgpPeerListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BgpPeerListResult)} does not support writing '{options.Format}' format."); + } + } + + BgpPeerListResult 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 DeserializeBgpPeerListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BgpPeerListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.cs new file mode 100644 index 0000000000000..2f11c58563839 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.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.ContainerOrchestratorRuntime.Models +{ + /// The response of a BgpPeer list operation. + internal partial class BgpPeerListResult + { + /// + /// 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 BgpPeer items on this page. + /// is null. + internal BgpPeerListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BgpPeer items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BgpPeerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BgpPeerListResult() + { + } + + /// The BgpPeer items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.Serialization.cs new file mode 100644 index 0000000000000..9f1eaebe61216 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.Serialization.cs @@ -0,0 +1,135 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + public partial class BlobStorageClassTypeProperties : 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(BlobStorageClassTypeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("azureStorageAccountName"u8); + writer.WriteStringValue(AzureStorageAccountName); + writer.WritePropertyName("azureStorageAccountKey"u8); + writer.WriteStringValue(AzureStorageAccountKey); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SCType.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(); + } + + BlobStorageClassTypeProperties 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(BlobStorageClassTypeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBlobStorageClassTypeProperties(document.RootElement, options); + } + + internal static BlobStorageClassTypeProperties DeserializeBlobStorageClassTypeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureStorageAccountName = default; + string azureStorageAccountKey = default; + SCType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureStorageAccountName"u8)) + { + azureStorageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureStorageAccountKey"u8)) + { + azureStorageAccountKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new SCType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BlobStorageClassTypeProperties(type, serializedAdditionalRawData, azureStorageAccountName, azureStorageAccountKey); + } + + 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(BlobStorageClassTypeProperties)} does not support writing '{options.Format}' format."); + } + } + + BlobStorageClassTypeProperties 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 DeserializeBlobStorageClassTypeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BlobStorageClassTypeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs new file mode 100644 index 0000000000000..831f96f09bc5e --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// The properties of Blob StorageClass. + public partial class BlobStorageClassTypeProperties : StorageClassTypeProperties + { + /// Initializes a new instance of . + /// Azure Storage Account Name. + /// Azure Storage Account Key. + /// or is null. + public BlobStorageClassTypeProperties(string azureStorageAccountName, string azureStorageAccountKey) + { + Argument.AssertNotNull(azureStorageAccountName, nameof(azureStorageAccountName)); + Argument.AssertNotNull(azureStorageAccountKey, nameof(azureStorageAccountKey)); + + AzureStorageAccountName = azureStorageAccountName; + AzureStorageAccountKey = azureStorageAccountKey; + SCType = SCType.Blob; + } + + /// Initializes a new instance of . + /// Type of the storage class. + /// Keeps track of any properties unknown to the library. + /// Azure Storage Account Name. + /// Azure Storage Account Key. + internal BlobStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData, string azureStorageAccountName, string azureStorageAccountKey) : base(scType, serializedAdditionalRawData) + { + AzureStorageAccountName = azureStorageAccountName; + AzureStorageAccountKey = azureStorageAccountKey; + SCType = scType; + } + + /// Initializes a new instance of for deserialization. + internal BlobStorageClassTypeProperties() + { + } + + /// Azure Storage Account Name. + public string AzureStorageAccountName { get; set; } + /// Azure Storage Account Key. + public string AzureStorageAccountKey { get; set; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/DataResilienceTier.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/DataResilienceTier.cs new file mode 100644 index 0000000000000..f4190209bde0b --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/DataResilienceTier.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.ContainerOrchestratorRuntime.Models +{ + /// Data resilience tier of a storage class. + public readonly partial struct DataResilienceTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataResilienceTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotDataResilientValue = "NotDataResilient"; + private const string DataResilientValue = "DataResilient"; + + /// Not data resilient. + public static DataResilienceTier NotDataResilient { get; } = new DataResilienceTier(NotDataResilientValue); + /// Data resilient. + public static DataResilienceTier DataResilient { get; } = new DataResilienceTier(DataResilientValue); + /// Determines if two values are the same. + public static bool operator ==(DataResilienceTier left, DataResilienceTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataResilienceTier left, DataResilienceTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DataResilienceTier(string value) => new DataResilienceTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataResilienceTier other && Equals(other); + /// + public bool Equals(DataResilienceTier 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/FailoverTier.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/FailoverTier.cs new file mode 100644 index 0000000000000..3673a9278f651 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/FailoverTier.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.ContainerOrchestratorRuntime.Models +{ + /// Failover tier of a storage class. + public readonly partial struct FailoverTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FailoverTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotAvailableValue = "NotAvailable"; + private const string SlowValue = "Slow"; + private const string FastValue = "Fast"; + private const string SuperValue = "Super"; + + /// Not available Failover Tier. + public static FailoverTier NotAvailable { get; } = new FailoverTier(NotAvailableValue); + /// Slow Failover Tier. + public static FailoverTier Slow { get; } = new FailoverTier(SlowValue); + /// Fast Failover Tier. + public static FailoverTier Fast { get; } = new FailoverTier(FastValue); + /// Super Failover Tier. + public static FailoverTier Super { get; } = new FailoverTier(SuperValue); + /// Determines if two values are the same. + public static bool operator ==(FailoverTier left, FailoverTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FailoverTier left, FailoverTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FailoverTier(string value) => new FailoverTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FailoverTier other && Equals(other); + /// + public bool Equals(FailoverTier 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.Serialization.cs new file mode 100644 index 0000000000000..773df54ed9c90 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + internal partial class LoadBalancerListResult : 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(LoadBalancerListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + LoadBalancerListResult 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(LoadBalancerListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLoadBalancerListResult(document.RootElement, options); + } + + internal static LoadBalancerListResult DeserializeLoadBalancerListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LoadBalancerData.DeserializeLoadBalancerData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LoadBalancerListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LoadBalancerListResult)} does not support writing '{options.Format}' format."); + } + } + + LoadBalancerListResult 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 DeserializeLoadBalancerListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LoadBalancerListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.cs new file mode 100644 index 0000000000000..3e41cfd9b6172 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.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.ContainerOrchestratorRuntime.Models +{ + /// The response of a LoadBalancer list operation. + internal partial class LoadBalancerListResult + { + /// + /// 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 LoadBalancer items on this page. + /// is null. + internal LoadBalancerListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The LoadBalancer items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal LoadBalancerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LoadBalancerListResult() + { + } + + /// The LoadBalancer items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.Serialization.cs new file mode 100644 index 0000000000000..3b6c69a037232 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.Serialization.cs @@ -0,0 +1,119 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + public partial class NativeStorageClassTypeProperties : 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(NativeStorageClassTypeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SCType.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(); + } + + NativeStorageClassTypeProperties 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(NativeStorageClassTypeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNativeStorageClassTypeProperties(document.RootElement, options); + } + + internal static NativeStorageClassTypeProperties DeserializeNativeStorageClassTypeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SCType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new SCType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NativeStorageClassTypeProperties(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NativeStorageClassTypeProperties)} does not support writing '{options.Format}' format."); + } + } + + NativeStorageClassTypeProperties 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 DeserializeNativeStorageClassTypeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NativeStorageClassTypeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs new file mode 100644 index 0000000000000..ec26a62ec04a0 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// The properties of Native StorageClass. + public partial class NativeStorageClassTypeProperties : StorageClassTypeProperties + { + /// Initializes a new instance of . + public NativeStorageClassTypeProperties() + { + SCType = SCType.Native; + } + + /// Initializes a new instance of . + /// Type of the storage class. + /// Keeps track of any properties unknown to the library. + internal NativeStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData) : base(scType, serializedAdditionalRawData) + { + SCType = scType; + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsDirectoryActionOnVolumeDeletion.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsDirectoryActionOnVolumeDeletion.cs new file mode 100644 index 0000000000000..9c745e1518c58 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsDirectoryActionOnVolumeDeletion.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.ContainerOrchestratorRuntime.Models +{ + /// The action to take when a NFS volume is deleted. + public readonly partial struct NfsDirectoryActionOnVolumeDeletion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NfsDirectoryActionOnVolumeDeletion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "Delete"; + private const string RetainValue = "Retain"; + + /// When the volume is deleted, delete the directory. + public static NfsDirectoryActionOnVolumeDeletion Delete { get; } = new NfsDirectoryActionOnVolumeDeletion(DeleteValue); + /// When the volume is deleted, retain the directory. + public static NfsDirectoryActionOnVolumeDeletion Retain { get; } = new NfsDirectoryActionOnVolumeDeletion(RetainValue); + /// Determines if two values are the same. + public static bool operator ==(NfsDirectoryActionOnVolumeDeletion left, NfsDirectoryActionOnVolumeDeletion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NfsDirectoryActionOnVolumeDeletion left, NfsDirectoryActionOnVolumeDeletion right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator NfsDirectoryActionOnVolumeDeletion(string value) => new NfsDirectoryActionOnVolumeDeletion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NfsDirectoryActionOnVolumeDeletion other && Equals(other); + /// + public bool Equals(NfsDirectoryActionOnVolumeDeletion 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.Serialization.cs new file mode 100644 index 0000000000000..fd7353ab55ebe --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.Serialization.cs @@ -0,0 +1,179 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + public partial class NfsStorageClassTypeProperties : 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(NfsStorageClassTypeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("server"u8); + writer.WriteStringValue(Server); + writer.WritePropertyName("share"u8); + writer.WriteStringValue(Share); + if (Optional.IsDefined(SubDir)) + { + writer.WritePropertyName("subDir"u8); + writer.WriteStringValue(SubDir); + } + if (Optional.IsDefined(MountPermissions)) + { + writer.WritePropertyName("mountPermissions"u8); + writer.WriteStringValue(MountPermissions); + } + if (Optional.IsDefined(OnDelete)) + { + writer.WritePropertyName("onDelete"u8); + writer.WriteStringValue(OnDelete.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SCType.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(); + } + + NfsStorageClassTypeProperties 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(NfsStorageClassTypeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNfsStorageClassTypeProperties(document.RootElement, options); + } + + internal static NfsStorageClassTypeProperties DeserializeNfsStorageClassTypeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string server = default; + string share = default; + string subDir = default; + string mountPermissions = default; + NfsDirectoryActionOnVolumeDeletion? onDelete = default; + SCType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("server"u8)) + { + server = property.Value.GetString(); + continue; + } + if (property.NameEquals("share"u8)) + { + share = property.Value.GetString(); + continue; + } + if (property.NameEquals("subDir"u8)) + { + subDir = property.Value.GetString(); + continue; + } + if (property.NameEquals("mountPermissions"u8)) + { + mountPermissions = property.Value.GetString(); + continue; + } + if (property.NameEquals("onDelete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onDelete = new NfsDirectoryActionOnVolumeDeletion(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new SCType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NfsStorageClassTypeProperties( + type, + serializedAdditionalRawData, + server, + share, + subDir, + mountPermissions, + onDelete); + } + + 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(NfsStorageClassTypeProperties)} does not support writing '{options.Format}' format."); + } + } + + NfsStorageClassTypeProperties 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 DeserializeNfsStorageClassTypeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NfsStorageClassTypeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs new file mode 100644 index 0000000000000..e6de7b13d45d5 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// The properties of NFS StorageClass. + public partial class NfsStorageClassTypeProperties : StorageClassTypeProperties + { + /// Initializes a new instance of . + /// NFS Server. + /// NFS share. + /// or is null. + public NfsStorageClassTypeProperties(string server, string share) + { + Argument.AssertNotNull(server, nameof(server)); + Argument.AssertNotNull(share, nameof(share)); + + Server = server; + Share = share; + SCType = SCType.NFS; + } + + /// Initializes a new instance of . + /// Type of the storage class. + /// Keeps track of any properties unknown to the library. + /// NFS Server. + /// NFS share. + /// Sub directory under share. If the sub directory doesn't exist, driver will create it. + /// Mounted folder permissions. Default is 0. If set as non-zero, driver will perform `chmod` after mount. + /// The action to take when a NFS volume is deleted. Default is Delete. + internal NfsStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData, string server, string share, string subDir, string mountPermissions, NfsDirectoryActionOnVolumeDeletion? onDelete) : base(scType, serializedAdditionalRawData) + { + Server = server; + Share = share; + SubDir = subDir; + MountPermissions = mountPermissions; + OnDelete = onDelete; + SCType = scType; + } + + /// Initializes a new instance of for deserialization. + internal NfsStorageClassTypeProperties() + { + } + + /// NFS Server. + public string Server { get; set; } + /// NFS share. + public string Share { get; set; } + /// Sub directory under share. If the sub directory doesn't exist, driver will create it. + public string SubDir { get; set; } + /// Mounted folder permissions. Default is 0. If set as non-zero, driver will perform `chmod` after mount. + public string MountPermissions { get; set; } + /// The action to take when a NFS volume is deleted. Default is Delete. + public NfsDirectoryActionOnVolumeDeletion? OnDelete { get; set; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/PerformanceTier.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/PerformanceTier.cs new file mode 100644 index 0000000000000..66ae19b5c6e1a --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/PerformanceTier.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.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// Performance tier of a storage class. + public readonly partial struct PerformanceTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PerformanceTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UndefinedValue = "Undefined"; + private const string BasicValue = "Basic"; + private const string StandardValue = "Standard"; + private const string PremiumValue = "Premium"; + private const string UltraValue = "Ultra"; + + /// Undefined Performance Tier. + public static PerformanceTier Undefined { get; } = new PerformanceTier(UndefinedValue); + /// Basic Performance Tier. + public static PerformanceTier Basic { get; } = new PerformanceTier(BasicValue); + /// Standard Performance Tier. + public static PerformanceTier Standard { get; } = new PerformanceTier(StandardValue); + /// Premium Performance Tier. + public static PerformanceTier Premium { get; } = new PerformanceTier(PremiumValue); + /// Ultra Performance Tier. + public static PerformanceTier Ultra { get; } = new PerformanceTier(UltraValue); + /// Determines if two values are the same. + public static bool operator ==(PerformanceTier left, PerformanceTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PerformanceTier left, PerformanceTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PerformanceTier(string value) => new PerformanceTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PerformanceTier other && Equals(other); + /// + public bool Equals(PerformanceTier 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ProvisioningState.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 0000000000000..667c04870245b --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/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.ContainerOrchestratorRuntime.Models +{ + /// The status of the current operation. + 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); + /// Initial provisioning in progress. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// Update in progress. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// Deletion in progress. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Change accepted for processing. + 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.Serialization.cs new file mode 100644 index 0000000000000..73fd70b4d4da7 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.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.ContainerOrchestratorRuntime.Models +{ + public partial class RwxStorageClassTypeProperties : 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(RwxStorageClassTypeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("backingStorageClassName"u8); + writer.WriteStringValue(BackingStorageClassName); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SCType.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(); + } + + RwxStorageClassTypeProperties 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(RwxStorageClassTypeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRwxStorageClassTypeProperties(document.RootElement, options); + } + + internal static RwxStorageClassTypeProperties DeserializeRwxStorageClassTypeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string backingStorageClassName = default; + SCType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("backingStorageClassName"u8)) + { + backingStorageClassName = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new SCType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RwxStorageClassTypeProperties(type, serializedAdditionalRawData, backingStorageClassName); + } + + 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(RwxStorageClassTypeProperties)} does not support writing '{options.Format}' format."); + } + } + + RwxStorageClassTypeProperties 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 DeserializeRwxStorageClassTypeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RwxStorageClassTypeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs new file mode 100644 index 0000000000000..d2430d8e15466 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// The properties of RWX StorageClass. + public partial class RwxStorageClassTypeProperties : StorageClassTypeProperties + { + /// Initializes a new instance of . + /// The backing storageclass used to create new storageclass. + /// is null. + public RwxStorageClassTypeProperties(string backingStorageClassName) + { + Argument.AssertNotNull(backingStorageClassName, nameof(backingStorageClassName)); + + BackingStorageClassName = backingStorageClassName; + SCType = SCType.RWX; + } + + /// Initializes a new instance of . + /// Type of the storage class. + /// Keeps track of any properties unknown to the library. + /// The backing storageclass used to create new storageclass. + internal RwxStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData, string backingStorageClassName) : base(scType, serializedAdditionalRawData) + { + BackingStorageClassName = backingStorageClassName; + SCType = scType; + } + + /// Initializes a new instance of for deserialization. + internal RwxStorageClassTypeProperties() + { + } + + /// The backing storageclass used to create new storageclass. + public string BackingStorageClassName { get; set; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SCType.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SCType.cs new file mode 100644 index 0000000000000..b41c8270f6cf8 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SCType.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.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// Type of a storage class. + internal readonly partial struct SCType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SCType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NativeValue = "Native"; + private const string RWXValue = "RWX"; + private const string BlobValue = "Blob"; + private const string NFSValue = "NFS"; + private const string SMBValue = "SMB"; + + /// Native storage class. + public static SCType Native { get; } = new SCType(NativeValue); + /// RWX storage class. + public static SCType RWX { get; } = new SCType(RWXValue); + /// Blob storage class. + public static SCType Blob { get; } = new SCType(BlobValue); + /// NFS storage class. + public static SCType NFS { get; } = new SCType(NFSValue); + /// SMB storage class. + public static SCType SMB { get; } = new SCType(SMBValue); + /// Determines if two values are the same. + public static bool operator ==(SCType left, SCType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SCType left, SCType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SCType(string value) => new SCType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SCType other && Equals(other); + /// + public bool Equals(SCType 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.Serialization.cs new file mode 100644 index 0000000000000..a92fd962ff6ec --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + internal partial class ServiceResourceListResult : 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(ServiceResourceListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServiceResourceListResult 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(ServiceResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceResourceListResult(document.RootElement, options); + } + + internal static ServiceResourceListResult DeserializeServiceResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ServiceResourceData.DeserializeServiceResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServiceResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + ServiceResourceListResult 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 DeserializeServiceResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.cs new file mode 100644 index 0000000000000..b9b27d103daf8 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.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.ContainerOrchestratorRuntime.Models +{ + /// The response of a ServiceResource list operation. + internal partial class ServiceResourceListResult + { + /// + /// 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 ServiceResource items on this page. + /// is null. + internal ServiceResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ServiceResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ServiceResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServiceResourceListResult() + { + } + + /// The ServiceResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.Serialization.cs new file mode 100644 index 0000000000000..bb21a65a1e80b --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + public partial class SmbStorageClassTypeProperties : 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(SmbStorageClassTypeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + if (Optional.IsDefined(SubDir)) + { + writer.WritePropertyName("subDir"u8); + writer.WriteStringValue(SubDir); + } + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(Domain)) + { + writer.WritePropertyName("domain"u8); + writer.WriteStringValue(Domain); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SCType.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(); + } + + SmbStorageClassTypeProperties 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(SmbStorageClassTypeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSmbStorageClassTypeProperties(document.RootElement, options); + } + + internal static SmbStorageClassTypeProperties DeserializeSmbStorageClassTypeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string source = default; + string subDir = default; + string username = default; + string password = default; + string domain = default; + SCType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("subDir"u8)) + { + subDir = property.Value.GetString(); + continue; + } + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new SCType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SmbStorageClassTypeProperties( + type, + serializedAdditionalRawData, + source, + subDir, + username, + password, + domain); + } + + 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(SmbStorageClassTypeProperties)} does not support writing '{options.Format}' format."); + } + } + + SmbStorageClassTypeProperties 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 DeserializeSmbStorageClassTypeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SmbStorageClassTypeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs new file mode 100644 index 0000000000000..89ae87aeb971c --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// The properties of SMB StorageClass. + public partial class SmbStorageClassTypeProperties : StorageClassTypeProperties + { + /// Initializes a new instance of . + /// SMB Source. + /// is null. + public SmbStorageClassTypeProperties(string source) + { + Argument.AssertNotNull(source, nameof(source)); + + Source = source; + SCType = SCType.SMB; + } + + /// Initializes a new instance of . + /// Type of the storage class. + /// Keeps track of any properties unknown to the library. + /// SMB Source. + /// Sub directory under share. If the sub directory doesn't exist, driver will create it. + /// Server username. + /// Server password. + /// Server domain. + internal SmbStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData, string source, string subDir, string username, string password, string domain) : base(scType, serializedAdditionalRawData) + { + Source = source; + SubDir = subDir; + Username = username; + Password = password; + Domain = domain; + SCType = scType; + } + + /// Initializes a new instance of for deserialization. + internal SmbStorageClassTypeProperties() + { + } + + /// SMB Source. + public string Source { get; set; } + /// Sub directory under share. If the sub directory doesn't exist, driver will create it. + public string SubDir { get; set; } + /// Server username. + public string Username { get; set; } + /// Server password. + public string Password { get; set; } + /// Server domain. + public string Domain { get; set; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs new file mode 100644 index 0000000000000..eef3c4e42537b --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs @@ -0,0 +1,286 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + public partial class StorageClassPropertiesUpdate : 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(StorageClassPropertiesUpdate)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AllowVolumeExpansion)) + { + writer.WritePropertyName("allowVolumeExpansion"u8); + writer.WriteStringValue(AllowVolumeExpansion.Value.ToString()); + } + if (Optional.IsCollectionDefined(MountOptions)) + { + writer.WritePropertyName("mountOptions"u8); + writer.WriteStartArray(); + foreach (var item in MountOptions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AccessModes)) + { + writer.WritePropertyName("accessModes"u8); + writer.WriteStartArray(); + foreach (var item in AccessModes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataResilience)) + { + writer.WritePropertyName("dataResilience"u8); + writer.WriteStringValue(DataResilience.Value.ToString()); + } + if (Optional.IsDefined(FailoverSpeed)) + { + writer.WritePropertyName("failoverSpeed"u8); + writer.WriteStringValue(FailoverSpeed.Value.ToString()); + } + if (Optional.IsCollectionDefined(Limitations)) + { + writer.WritePropertyName("limitations"u8); + writer.WriteStartArray(); + foreach (var item in Limitations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Performance)) + { + writer.WritePropertyName("performance"u8); + writer.WriteStringValue(Performance.Value.ToString()); + } + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority.Value); + } + if (Optional.IsDefined(TypeProperties)) + { + writer.WritePropertyName("typeProperties"u8); + writer.WriteObjectValue(TypeProperties, 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(); + } + + StorageClassPropertiesUpdate 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(StorageClassPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageClassPropertiesUpdate(document.RootElement, options); + } + + internal static StorageClassPropertiesUpdate DeserializeStorageClassPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VolumeExpansion? allowVolumeExpansion = default; + IList mountOptions = default; + IList accessModes = default; + DataResilienceTier? dataResilience = default; + FailoverTier? failoverSpeed = default; + IList limitations = default; + PerformanceTier? performance = default; + long? priority = default; + StorageClassTypePropertiesUpdate typeProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("allowVolumeExpansion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowVolumeExpansion = new VolumeExpansion(property.Value.GetString()); + continue; + } + if (property.NameEquals("mountOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + mountOptions = array; + continue; + } + if (property.NameEquals("accessModes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AccessMode(item.GetString())); + } + accessModes = array; + continue; + } + if (property.NameEquals("dataResilience"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataResilience = new DataResilienceTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("failoverSpeed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failoverSpeed = new FailoverTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("limitations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + limitations = array; + continue; + } + if (property.NameEquals("performance"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + performance = new PerformanceTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("priority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("typeProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + typeProperties = StorageClassTypePropertiesUpdate.DeserializeStorageClassTypePropertiesUpdate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageClassPropertiesUpdate( + allowVolumeExpansion, + mountOptions ?? new ChangeTrackingList(), + accessModes ?? new ChangeTrackingList(), + dataResilience, + failoverSpeed, + limitations ?? new ChangeTrackingList(), + performance, + priority, + typeProperties, + 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(StorageClassPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + StorageClassPropertiesUpdate 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 DeserializeStorageClassPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageClassPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.cs new file mode 100644 index 0000000000000..5a2ce1d881bb5 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// The model for updating storageClass properties. + public partial class StorageClassPropertiesUpdate + { + /// + /// 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 StorageClassPropertiesUpdate() + { + MountOptions = new ChangeTrackingList(); + AccessModes = new ChangeTrackingList(); + Limitations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Volume can be expanded or not. + /// Additional mount options. + /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. + /// Allow single data node failure. + /// Failover speed: NA, Slow, Fast. + /// Limitations of the storage class. + /// Performance tier. + /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. + /// New storage class type of storageClass. + /// Keeps track of any properties unknown to the library. + internal StorageClassPropertiesUpdate(VolumeExpansion? allowVolumeExpansion, IList mountOptions, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypePropertiesUpdate typeProperties, IDictionary serializedAdditionalRawData) + { + AllowVolumeExpansion = allowVolumeExpansion; + MountOptions = mountOptions; + AccessModes = accessModes; + DataResilience = dataResilience; + FailoverSpeed = failoverSpeed; + Limitations = limitations; + Performance = performance; + Priority = priority; + TypeProperties = typeProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Volume can be expanded or not. + public VolumeExpansion? AllowVolumeExpansion { get; set; } + /// Additional mount options. + public IList MountOptions { get; } + /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. + public IList AccessModes { get; } + /// Allow single data node failure. + public DataResilienceTier? DataResilience { get; set; } + /// Failover speed: NA, Slow, Fast. + public FailoverTier? FailoverSpeed { get; set; } + /// Limitations of the storage class. + public IList Limitations { get; } + /// Performance tier. + public PerformanceTier? Performance { get; set; } + /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. + public long? Priority { get; set; } + /// New storage class type of storageClass. + public StorageClassTypePropertiesUpdate TypeProperties { get; set; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.Serialization.cs new file mode 100644 index 0000000000000..4239bb17d9356 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + internal partial class StorageClassResourceListResult : 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(StorageClassResourceListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + StorageClassResourceListResult 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(StorageClassResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageClassResourceListResult(document.RootElement, options); + } + + internal static StorageClassResourceListResult DeserializeStorageClassResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StorageClassResourceData.DeserializeStorageClassResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageClassResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StorageClassResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + StorageClassResourceListResult 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 DeserializeStorageClassResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageClassResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.cs new file mode 100644 index 0000000000000..d9a5c74a8ed5c --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.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.ContainerOrchestratorRuntime.Models +{ + /// The response of a StorageClassResource list operation. + internal partial class StorageClassResourceListResult + { + /// + /// 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 StorageClassResource items on this page. + /// is null. + internal StorageClassResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The StorageClassResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal StorageClassResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StorageClassResourceListResult() + { + } + + /// The StorageClassResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.Serialization.cs new file mode 100644 index 0000000000000..68b0af7b40212 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + public partial class StorageClassResourcePatch : 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(StorageClassResourcePatch)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, 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(); + } + + StorageClassResourcePatch 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(StorageClassResourcePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageClassResourcePatch(document.RootElement, options); + } + + internal static StorageClassResourcePatch DeserializeStorageClassResourcePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StorageClassPropertiesUpdate properties = 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 = StorageClassPropertiesUpdate.DeserializeStorageClassPropertiesUpdate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageClassResourcePatch(properties, 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(StorageClassResourcePatch)} does not support writing '{options.Format}' format."); + } + } + + StorageClassResourcePatch 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 DeserializeStorageClassResourcePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageClassResourcePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.cs new file mode 100644 index 0000000000000..643fab998c6d2 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// The model for updating a storageClass. + public partial class StorageClassResourcePatch + { + /// + /// 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 StorageClassResourcePatch() + { + } + + /// Initializes a new instance of . + /// The properties of StorageClass. + /// Keeps track of any properties unknown to the library. + internal StorageClassResourcePatch(StorageClassPropertiesUpdate properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The properties of StorageClass. + public StorageClassPropertiesUpdate Properties { get; set; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs new file mode 100644 index 0000000000000..07b29695aff07 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + [PersistableModelProxy(typeof(UnknownStorageClassTypeProperties))] + public partial class StorageClassTypeProperties : 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(StorageClassTypeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SCType.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(); + } + + StorageClassTypeProperties 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(StorageClassTypeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageClassTypeProperties(document.RootElement, options); + } + + internal static StorageClassTypeProperties DeserializeStorageClassTypeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Blob": return BlobStorageClassTypeProperties.DeserializeBlobStorageClassTypeProperties(element, options); + case "Native": return NativeStorageClassTypeProperties.DeserializeNativeStorageClassTypeProperties(element, options); + case "NFS": return NfsStorageClassTypeProperties.DeserializeNfsStorageClassTypeProperties(element, options); + case "RWX": return RwxStorageClassTypeProperties.DeserializeRwxStorageClassTypeProperties(element, options); + case "SMB": return SmbStorageClassTypeProperties.DeserializeSmbStorageClassTypeProperties(element, options); + } + } + return UnknownStorageClassTypeProperties.DeserializeUnknownStorageClassTypeProperties(element, options); + } + + 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(StorageClassTypeProperties)} does not support writing '{options.Format}' format."); + } + } + + StorageClassTypeProperties 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 DeserializeStorageClassTypeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageClassTypeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs new file mode 100644 index 0000000000000..cfc21cf345f95 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// + /// The properties of storage class of the StorageClass + /// 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 , , , and . + /// + public abstract partial class StorageClassTypeProperties + { + /// + /// 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 . + protected StorageClassTypeProperties() + { + } + + /// Initializes a new instance of . + /// Type of the storage class. + /// Keeps track of any properties unknown to the library. + internal StorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData) + { + SCType = scType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of the storage class. + internal SCType SCType { get; set; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.Serialization.cs new file mode 100644 index 0000000000000..119efdefc850f --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.Serialization.cs @@ -0,0 +1,260 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + public partial class StorageClassTypePropertiesUpdate : 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(StorageClassTypePropertiesUpdate)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BackingStorageClassName)) + { + writer.WritePropertyName("backingStorageClassName"u8); + writer.WriteStringValue(BackingStorageClassName); + } + if (Optional.IsDefined(AzureStorageAccountName)) + { + writer.WritePropertyName("azureStorageAccountName"u8); + writer.WriteStringValue(AzureStorageAccountName); + } + if (Optional.IsDefined(AzureStorageAccountKey)) + { + writer.WritePropertyName("azureStorageAccountKey"u8); + writer.WriteStringValue(AzureStorageAccountKey); + } + if (Optional.IsDefined(Server)) + { + writer.WritePropertyName("server"u8); + writer.WriteStringValue(Server); + } + if (Optional.IsDefined(Share)) + { + writer.WritePropertyName("share"u8); + writer.WriteStringValue(Share); + } + if (Optional.IsDefined(SubDir)) + { + writer.WritePropertyName("subDir"u8); + writer.WriteStringValue(SubDir); + } + if (Optional.IsDefined(MountPermissions)) + { + writer.WritePropertyName("mountPermissions"u8); + writer.WriteStringValue(MountPermissions); + } + if (Optional.IsDefined(OnDelete)) + { + writer.WritePropertyName("onDelete"u8); + writer.WriteStringValue(OnDelete.Value.ToString()); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(Domain)) + { + writer.WritePropertyName("domain"u8); + writer.WriteStringValue(Domain); + } + 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(); + } + + StorageClassTypePropertiesUpdate 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(StorageClassTypePropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageClassTypePropertiesUpdate(document.RootElement, options); + } + + internal static StorageClassTypePropertiesUpdate DeserializeStorageClassTypePropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string backingStorageClassName = default; + string azureStorageAccountName = default; + string azureStorageAccountKey = default; + string server = default; + string share = default; + string subDir = default; + string mountPermissions = default; + NfsDirectoryActionOnVolumeDeletion? onDelete = default; + string source = default; + string username = default; + string password = default; + string domain = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("backingStorageClassName"u8)) + { + backingStorageClassName = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureStorageAccountName"u8)) + { + azureStorageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureStorageAccountKey"u8)) + { + azureStorageAccountKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("server"u8)) + { + server = property.Value.GetString(); + continue; + } + if (property.NameEquals("share"u8)) + { + share = property.Value.GetString(); + continue; + } + if (property.NameEquals("subDir"u8)) + { + subDir = property.Value.GetString(); + continue; + } + if (property.NameEquals("mountPermissions"u8)) + { + mountPermissions = property.Value.GetString(); + continue; + } + if (property.NameEquals("onDelete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onDelete = new NfsDirectoryActionOnVolumeDeletion(property.Value.GetString()); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageClassTypePropertiesUpdate( + backingStorageClassName, + azureStorageAccountName, + azureStorageAccountKey, + server, + share, + subDir, + mountPermissions, + onDelete, + source, + username, + password, + domain, + 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(StorageClassTypePropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + StorageClassTypePropertiesUpdate 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 DeserializeStorageClassTypePropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageClassTypePropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.cs new file mode 100644 index 0000000000000..8a5687727b186 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// The model for update a storageClass. + public partial class StorageClassTypePropertiesUpdate + { + /// + /// 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 StorageClassTypePropertiesUpdate() + { + } + + /// Initializes a new instance of . + /// The backing storageclass used to create new storageclass. + /// Azure Storage Account Name. + /// Azure Storage Account Key. + /// NFS Server. + /// NFS share. + /// Sub directory under share. If the sub directory doesn't exist, driver will create it. + /// Mounted folder permissions. Default is 0. If set as non-zero, driver will perform `chmod` after mount. + /// The action to take when a NFS volume is deleted. Default is Delete. + /// SMB Source. + /// Server username. + /// Server password. + /// Server domain. + /// Keeps track of any properties unknown to the library. + internal StorageClassTypePropertiesUpdate(string backingStorageClassName, string azureStorageAccountName, string azureStorageAccountKey, string server, string share, string subDir, string mountPermissions, NfsDirectoryActionOnVolumeDeletion? onDelete, string source, string username, string password, string domain, IDictionary serializedAdditionalRawData) + { + BackingStorageClassName = backingStorageClassName; + AzureStorageAccountName = azureStorageAccountName; + AzureStorageAccountKey = azureStorageAccountKey; + Server = server; + Share = share; + SubDir = subDir; + MountPermissions = mountPermissions; + OnDelete = onDelete; + Source = source; + Username = username; + Password = password; + Domain = domain; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The backing storageclass used to create new storageclass. + public string BackingStorageClassName { get; set; } + /// Azure Storage Account Name. + public string AzureStorageAccountName { get; set; } + /// Azure Storage Account Key. + public string AzureStorageAccountKey { get; set; } + /// NFS Server. + public string Server { get; set; } + /// NFS share. + public string Share { get; set; } + /// Sub directory under share. If the sub directory doesn't exist, driver will create it. + public string SubDir { get; set; } + /// Mounted folder permissions. Default is 0. If set as non-zero, driver will perform `chmod` after mount. + public string MountPermissions { get; set; } + /// The action to take when a NFS volume is deleted. Default is Delete. + public NfsDirectoryActionOnVolumeDeletion? OnDelete { get; set; } + /// SMB Source. + public string Source { get; set; } + /// Server username. + public string Username { get; set; } + /// Server password. + public string Password { get; set; } + /// Server domain. + public string Domain { get; set; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.Serialization.cs new file mode 100644 index 0000000000000..f40e92f5dd231 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.Serialization.cs @@ -0,0 +1,119 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + internal partial class UnknownStorageClassTypeProperties : 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(StorageClassTypeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SCType.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(); + } + + StorageClassTypeProperties 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(StorageClassTypeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageClassTypeProperties(document.RootElement, options); + } + + internal static UnknownStorageClassTypeProperties DeserializeUnknownStorageClassTypeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SCType type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new SCType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownStorageClassTypeProperties(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StorageClassTypeProperties)} does not support writing '{options.Format}' format."); + } + } + + StorageClassTypeProperties 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 DeserializeStorageClassTypeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageClassTypeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs new file mode 100644 index 0000000000000..5274d90a3b2be --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// Unknown version of StorageClassTypeProperties. + internal partial class UnknownStorageClassTypeProperties : StorageClassTypeProperties + { + /// Initializes a new instance of . + /// Type of the storage class. + /// Keeps track of any properties unknown to the library. + internal UnknownStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData) : base(scType, serializedAdditionalRawData) + { + SCType = scType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownStorageClassTypeProperties() + { + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeBindingMode.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeBindingMode.cs new file mode 100644 index 0000000000000..7b7308f9cc42f --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeBindingMode.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.ContainerOrchestratorRuntime.Models +{ + /// Storage class volume binding mode. + public readonly partial struct VolumeBindingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VolumeBindingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ImmediateValue = "Immediate"; + private const string WaitForFirstConsumerValue = "WaitForFirstConsumer"; + + /// Immediate binding mode. + public static VolumeBindingMode Immediate { get; } = new VolumeBindingMode(ImmediateValue); + /// Wait for first consumer binding mode. + public static VolumeBindingMode WaitForFirstConsumer { get; } = new VolumeBindingMode(WaitForFirstConsumerValue); + /// Determines if two values are the same. + public static bool operator ==(VolumeBindingMode left, VolumeBindingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VolumeBindingMode left, VolumeBindingMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator VolumeBindingMode(string value) => new VolumeBindingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VolumeBindingMode other && Equals(other); + /// + public bool Equals(VolumeBindingMode 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeExpansion.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeExpansion.cs new file mode 100644 index 0000000000000..b7747ae1b62e3 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeExpansion.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.ContainerOrchestratorRuntime.Models +{ + /// Ability to expand volumes of a storage class. + public readonly partial struct VolumeExpansion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VolumeExpansion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AllowValue = "Allow"; + private const string DisallowValue = "Disallow"; + + /// Allow volume expansion. + public static VolumeExpansion Allow { get; } = new VolumeExpansion(AllowValue); + /// Disallow volume expansion. + public static VolumeExpansion Disallow { get; } = new VolumeExpansion(DisallowValue); + /// Determines if two values are the same. + public static bool operator ==(VolumeExpansion left, VolumeExpansion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VolumeExpansion left, VolumeExpansion right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator VolumeExpansion(string value) => new VolumeExpansion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VolumeExpansion other && Equals(other); + /// + public bool Equals(VolumeExpansion 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ProviderConstants.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ProviderConstants.cs new file mode 100644 index 0000000000000..de0af46b5e47f --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/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.ContainerOrchestratorRuntime +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs new file mode 100644 index 0000000000000..96dee5b5569ad --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs @@ -0,0 +1,437 @@ +// 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.ContainerOrchestratorRuntime.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + internal partial class BgpPeersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BgpPeersRestOperations. + /// 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 BgpPeersRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BgpPeer resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BgpPeerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BgpPeerListResult.DeserializeBgpPeerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BgpPeer resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public Response List(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BgpPeerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BgpPeerListResult.DeserializeBgpPeerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string bgpPeerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers/", false); + uri.AppendPath(bgpPeerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string resourceUri, string bgpPeerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers/", false); + uri.AppendPath(bgpPeerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BgpPeer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the BgpPeer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string resourceUri, string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var message = CreateGetRequest(resourceUri, bgpPeerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BgpPeerData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BgpPeerData.DeserializeBgpPeerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BgpPeerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BgpPeer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the BgpPeer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Get(string resourceUri, string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var message = CreateGetRequest(resourceUri, bgpPeerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BgpPeerData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BgpPeerData.DeserializeBgpPeerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BgpPeerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string bgpPeerName, BgpPeerData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers/", false); + uri.AppendPath(bgpPeerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string bgpPeerName, BgpPeerData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers/", false); + uri.AppendPath(bgpPeerName, 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; + } + + /// Create a BgpPeer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the BgpPeer. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string resourceUri, string bgpPeerName, BgpPeerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, bgpPeerName, 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); + } + } + + /// Create a BgpPeer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the BgpPeer. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string resourceUri, string bgpPeerName, BgpPeerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, bgpPeerName, data); + _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 resourceUri, string bgpPeerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers/", false); + uri.AppendPath(bgpPeerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string resourceUri, string bgpPeerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers/", false); + uri.AppendPath(bgpPeerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BgpPeer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the BgpPeer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string resourceUri, string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var message = CreateDeleteRequest(resourceUri, bgpPeerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BgpPeer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the BgpPeer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Delete(string resourceUri, string bgpPeerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); + + using var message = CreateDeleteRequest(resourceUri, bgpPeerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceUri) + { + 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 BgpPeer resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public async Task> ListNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BgpPeerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BgpPeerListResult.DeserializeBgpPeerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BgpPeer resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public Response ListNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BgpPeerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BgpPeerListResult.DeserializeBgpPeerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs new file mode 100644 index 0000000000000..0ee2b418d8852 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs @@ -0,0 +1,437 @@ +// 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.ContainerOrchestratorRuntime.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + internal partial class LoadBalancersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of LoadBalancersRestOperations. + /// 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 LoadBalancersRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List LoadBalancer resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LoadBalancerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = LoadBalancerListResult.DeserializeLoadBalancerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List LoadBalancer resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public Response List(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LoadBalancerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = LoadBalancerListResult.DeserializeLoadBalancerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string loadBalancerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers/", false); + uri.AppendPath(loadBalancerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string resourceUri, string loadBalancerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers/", false); + uri.AppendPath(loadBalancerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a LoadBalancer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string resourceUri, string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var message = CreateGetRequest(resourceUri, loadBalancerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LoadBalancerData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = LoadBalancerData.DeserializeLoadBalancerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((LoadBalancerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a LoadBalancer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Get(string resourceUri, string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var message = CreateGetRequest(resourceUri, loadBalancerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LoadBalancerData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = LoadBalancerData.DeserializeLoadBalancerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((LoadBalancerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string loadBalancerName, LoadBalancerData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers/", false); + uri.AppendPath(loadBalancerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string loadBalancerName, LoadBalancerData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers/", false); + uri.AppendPath(loadBalancerName, 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; + } + + /// Create a LoadBalancer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the LoadBalancer. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string resourceUri, string loadBalancerName, LoadBalancerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, loadBalancerName, 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); + } + } + + /// Create a LoadBalancer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the LoadBalancer. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string resourceUri, string loadBalancerName, LoadBalancerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, loadBalancerName, data); + _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 resourceUri, string loadBalancerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers/", false); + uri.AppendPath(loadBalancerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string resourceUri, string loadBalancerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers/", false); + uri.AppendPath(loadBalancerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a LoadBalancer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string resourceUri, string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var message = CreateDeleteRequest(resourceUri, loadBalancerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a LoadBalancer. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the LoadBalancer. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Delete(string resourceUri, string loadBalancerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); + + using var message = CreateDeleteRequest(resourceUri, loadBalancerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceUri) + { + 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 LoadBalancer resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public async Task> ListNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LoadBalancerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = LoadBalancerListResult.DeserializeLoadBalancerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List LoadBalancer resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public Response ListNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LoadBalancerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = LoadBalancerListResult.DeserializeLoadBalancerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs new file mode 100644 index 0000000000000..f6cc742bcc302 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs @@ -0,0 +1,447 @@ +// 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.ContainerOrchestratorRuntime.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + internal partial class ServicesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ServicesRestOperations. + /// 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 ServicesRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ServiceResource resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceResourceListResult.DeserializeServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ServiceResource resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public Response List(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceResourceListResult.DeserializeServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string serviceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services/", false); + uri.AppendPath(serviceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string resourceUri, string serviceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services/", false); + uri.AppendPath(serviceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ServiceResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the service. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string resourceUri, string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var message = CreateGetRequest(resourceUri, serviceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceResourceData.DeserializeServiceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ServiceResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the service. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Get(string resourceUri, string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var message = CreateGetRequest(resourceUri, serviceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceResourceData.DeserializeServiceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string serviceName, ServiceResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services/", false); + uri.AppendPath(serviceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string serviceName, ServiceResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services/", false); + uri.AppendPath(serviceName, 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; + } + + /// Create a ServiceResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the service. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string resourceUri, string serviceName, ServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, serviceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + ServiceResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceResourceData.DeserializeServiceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a ServiceResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the service. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string resourceUri, string serviceName, ServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, serviceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + ServiceResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceResourceData.DeserializeServiceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string resourceUri, string serviceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services/", false); + uri.AppendPath(serviceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string resourceUri, string serviceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services/", false); + uri.AppendPath(serviceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a ServiceResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the service. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string resourceUri, string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var message = CreateDeleteRequest(resourceUri, serviceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a ServiceResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the service. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Delete(string resourceUri, string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var message = CreateDeleteRequest(resourceUri, serviceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceUri) + { + 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 ServiceResource resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public async Task> ListNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceResourceListResult.DeserializeServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ServiceResource resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public Response ListNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceResourceListResult.DeserializeServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs new file mode 100644 index 0000000000000..c6153c6adf909 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs @@ -0,0 +1,521 @@ +// 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.ContainerOrchestratorRuntime.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + internal partial class StorageClassRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of StorageClassRestOperations. + /// 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 StorageClassRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List StorageClassResource resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StorageClassResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StorageClassResourceListResult.DeserializeStorageClassResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List StorageClassResource resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public Response List(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StorageClassResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StorageClassResourceListResult.DeserializeStorageClassResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string storageClassName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses/", false); + uri.AppendPath(storageClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string resourceUri, string storageClassName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses/", false); + uri.AppendPath(storageClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a StorageClassResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the storage class. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string resourceUri, string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var message = CreateGetRequest(resourceUri, storageClassName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StorageClassResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StorageClassResourceData.DeserializeStorageClassResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((StorageClassResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a StorageClassResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the storage class. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Get(string resourceUri, string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var message = CreateGetRequest(resourceUri, storageClassName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StorageClassResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StorageClassResourceData.DeserializeStorageClassResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((StorageClassResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string storageClassName, StorageClassResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses/", false); + uri.AppendPath(storageClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string storageClassName, StorageClassResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses/", false); + uri.AppendPath(storageClassName, 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; + } + + /// Create a StorageClassResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the storage class. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string resourceUri, string storageClassName, StorageClassResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, storageClassName, 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); + } + } + + /// Create a StorageClassResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the storage class. + /// Resource create parameters. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string resourceUri, string storageClassName, StorageClassResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(resourceUri, storageClassName, data); + _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 resourceUri, string storageClassName, StorageClassResourcePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses/", false); + uri.AppendPath(storageClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string resourceUri, string storageClassName, StorageClassResourcePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses/", false); + uri.AppendPath(storageClassName, 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; + } + + /// Update a StorageClassResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the storage class. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string resourceUri, string storageClassName, StorageClassResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(resourceUri, storageClassName, patch); + 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 StorageClassResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the storage class. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response Update(string resourceUri, string storageClassName, StorageClassResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(resourceUri, storageClassName, patch); + _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 resourceUri, string storageClassName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses/", false); + uri.AppendPath(storageClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string resourceUri, string storageClassName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses/", false); + uri.AppendPath(storageClassName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a StorageClassResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the storage class. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string resourceUri, string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var message = CreateDeleteRequest(resourceUri, storageClassName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a StorageClassResource. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The name of the the storage class. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Delete(string resourceUri, string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var message = CreateDeleteRequest(resourceUri, storageClassName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceUri) + { + 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 StorageClassResource resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public async Task> ListNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StorageClassResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StorageClassResourceListResult.DeserializeStorageClassResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List StorageClassResource resources by parent. + /// The URL to the next page of results. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// or is null. + public Response ListNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListNextPageRequest(nextLink, resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StorageClassResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StorageClassResourceListResult.DeserializeStorageClassResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.Serialization.cs new file mode 100644 index 0000000000000..8614d57cef793 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.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.ContainerOrchestratorRuntime +{ + public partial class ServiceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ServiceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ServiceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.cs new file mode 100644 index 0000000000000..5b0ea5aa01744 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.cs @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// A Class representing a ServiceResource 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 GetServiceResource method. + /// Otherwise you can get one from its parent resource using the GetServiceResource method. + /// + public partial class ServiceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The resourceUri. + /// The serviceName. + public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string serviceName) + { + var resourceId = $"{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _serviceResourceServicesClientDiagnostics; + private readonly ServicesRestOperations _serviceResourceServicesRestClient; + private readonly ServiceResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.KubernetesRuntime/services"; + + /// Initializes a new instance of the class for mocking. + protected ServiceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ServiceResource(ArmClient client, ServiceResourceData 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 ServiceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serviceResourceServicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string serviceResourceServicesApiVersion); + _serviceResourceServicesRestClient = new ServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceResourceServicesApiVersion); +#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 ServiceResourceData 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 ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Get"); + scope.Start(); + try + { + var response = await _serviceResourceServicesRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Get"); + scope.Start(); + try + { + var response = _serviceResourceServicesRestClient.Get(Id.Parent, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Delete"); + scope.Start(); + try + { + var response = await _serviceResourceServicesRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _serviceResourceServicesRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Delete"); + scope.Start(); + try + { + var response = _serviceResourceServicesRestClient.Delete(Id.Parent, Id.Name, cancellationToken); + var uri = _serviceResourceServicesRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Update"); + scope.Start(); + try + { + var response = await _serviceResourceServicesRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _serviceResourceServicesRestClient.CreateCreateOrUpdateRequestUri(Id.Parent, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Update"); + scope.Start(); + try + { + var response = _serviceResourceServicesRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); + var uri = _serviceResourceServicesRestClient.CreateCreateOrUpdateRequestUri(Id.Parent, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ServiceResource(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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceCollection.cs new file mode 100644 index 0000000000000..7efbb57f6d322 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceCollection.cs @@ -0,0 +1,487 @@ +// 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.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// 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 GetServiceResources method from an instance of . + /// + public partial class ServiceResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _serviceResourceServicesClientDiagnostics; + private readonly ServicesRestOperations _serviceResourceServicesRestClient; + + /// Initializes a new instance of the class for mocking. + protected ServiceResourceCollection() + { + } + + /// 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 ServiceResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serviceResourceServicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ServiceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ServiceResource.ResourceType, out string serviceResourceServicesApiVersion); + _serviceResourceServicesRestClient = new ServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceResourceServicesApiVersion); + } + + /// + /// Create a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the the service. + /// 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 serviceName, ServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _serviceResourceServicesRestClient.CreateOrUpdateAsync(Id, serviceName, data, cancellationToken).ConfigureAwait(false); + var uri = _serviceResourceServicesRestClient.CreateCreateOrUpdateRequestUri(Id, serviceName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the the service. + /// 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 serviceName, ServiceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _serviceResourceServicesRestClient.CreateOrUpdate(Id, serviceName, data, cancellationToken); + var uri = _serviceResourceServicesRestClient.CreateCreateOrUpdateRequestUri(Id, serviceName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the service. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.Get"); + scope.Start(); + try + { + var response = await _serviceResourceServicesRestClient.GetAsync(Id, serviceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ServiceResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the service. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.Get"); + scope.Start(); + try + { + var response = _serviceResourceServicesRestClient.Get(Id, serviceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ServiceResource resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services + /// + /// + /// Operation Id + /// Services_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _serviceResourceServicesRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceResourceServicesRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceResource(Client, ServiceResourceData.DeserializeServiceResourceData(e)), _serviceResourceServicesClientDiagnostics, Pipeline, "ServiceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ServiceResource resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services + /// + /// + /// Operation Id + /// Services_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _serviceResourceServicesRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceResourceServicesRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceResource(Client, ServiceResourceData.DeserializeServiceResourceData(e)), _serviceResourceServicesClientDiagnostics, Pipeline, "ServiceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the service. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _serviceResourceServicesRestClient.GetAsync(Id, serviceName, 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 + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the service. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.Exists"); + scope.Start(); + try + { + var response = _serviceResourceServicesRestClient.Get(Id, serviceName, 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 + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the service. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _serviceResourceServicesRestClient.GetAsync(Id, serviceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the service. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string serviceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); + + using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _serviceResourceServicesRestClient.Get(Id, serviceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServiceResource(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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs new file mode 100644 index 0000000000000..7a5b36d4d2dac --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs @@ -0,0 +1,209 @@ +// 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.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + public partial class ServiceResourceData : 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(ServiceResourceData)} 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 (options.Format != "W" && Optional.IsDefined(RpObjectId)) + { + writer.WritePropertyName("rpObjectId"u8); + writer.WriteStringValue(RpObjectId); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + 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(); + } + + ServiceResourceData 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(ServiceResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceResourceData(document.RootElement, options); + } + + internal static ServiceResourceData DeserializeServiceResourceData(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 rpObjectId = default; + ProvisioningState? provisioningState = 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("rpObjectId"u8)) + { + rpObjectId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceResourceData( + id, + name, + type, + systemData, + rpObjectId, + 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(ServiceResourceData)} does not support writing '{options.Format}' format."); + } + } + + ServiceResourceData 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 DeserializeServiceResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs new file mode 100644 index 0000000000000..b5d1caa805142 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// A class representing the ServiceResource data model. + /// A Service resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) + /// + public partial class ServiceResourceData : 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 ServiceResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The object id of the service principal of the RP provisioned in the tenant. + /// Resource provision state. + /// Keeps track of any properties unknown to the library. + internal ServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string rpObjectId, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + RpObjectId = rpObjectId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The object id of the service principal of the RP provisioned in the tenant. + public string RpObjectId { get; } + /// Resource provision state. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.Serialization.cs new file mode 100644 index 0000000000000..3be86aea9116e --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.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.ContainerOrchestratorRuntime +{ + public partial class StorageClassResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + StorageClassResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + StorageClassResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.cs new file mode 100644 index 0000000000000..478b6eb03d809 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.cs @@ -0,0 +1,346 @@ +// 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.ContainerOrchestratorRuntime.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// A Class representing a StorageClassResource 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 GetStorageClassResource method. + /// Otherwise you can get one from its parent resource using the GetStorageClassResource method. + /// + public partial class StorageClassResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The resourceUri. + /// The storageClassName. + public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string storageClassName) + { + var resourceId = $"{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _storageClassResourceStorageClassClientDiagnostics; + private readonly StorageClassRestOperations _storageClassResourceStorageClassRestClient; + private readonly StorageClassResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.KubernetesRuntime/storageClasses"; + + /// Initializes a new instance of the class for mocking. + protected StorageClassResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal StorageClassResource(ArmClient client, StorageClassResourceData 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 StorageClassResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _storageClassResourceStorageClassClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string storageClassResourceStorageClassApiVersion); + _storageClassResourceStorageClassRestClient = new StorageClassRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, storageClassResourceStorageClassApiVersion); +#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 StorageClassResourceData 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 StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Get"); + scope.Start(); + try + { + var response = await _storageClassResourceStorageClassRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Get"); + scope.Start(); + try + { + var response = _storageClassResourceStorageClassRestClient.Get(Id.Parent, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Delete"); + scope.Start(); + try + { + var response = await _storageClassResourceStorageClassRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(_storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Delete"); + scope.Start(); + try + { + var response = _storageClassResourceStorageClassRestClient.Delete(Id.Parent, Id.Name, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(_storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Update + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, StorageClassResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Update"); + scope.Start(); + try + { + var response = await _storageClassResourceStorageClassRestClient.UpdateAsync(Id.Parent, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new StorageClassResourceOperationSource(Client), _storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Update + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, StorageClassResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Update"); + scope.Start(); + try + { + var response = _storageClassResourceStorageClassRestClient.Update(Id.Parent, Id.Name, patch, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new StorageClassResourceOperationSource(Client), _storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceCollection.cs new file mode 100644 index 0000000000000..7c1f5b762300a --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceCollection.cs @@ -0,0 +1,483 @@ +// 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.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// 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 GetStorageClassResources method from an instance of . + /// + public partial class StorageClassResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _storageClassResourceStorageClassClientDiagnostics; + private readonly StorageClassRestOperations _storageClassResourceStorageClassRestClient; + + /// Initializes a new instance of the class for mocking. + protected StorageClassResourceCollection() + { + } + + /// 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 StorageClassResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _storageClassResourceStorageClassClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", StorageClassResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(StorageClassResource.ResourceType, out string storageClassResourceStorageClassApiVersion); + _storageClassResourceStorageClassRestClient = new StorageClassRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, storageClassResourceStorageClassApiVersion); + } + + /// + /// Create a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the the storage class. + /// 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 storageClassName, StorageClassResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _storageClassResourceStorageClassRestClient.CreateOrUpdateAsync(Id, storageClassName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new StorageClassResourceOperationSource(Client), _storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateCreateOrUpdateRequest(Id, storageClassName, 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 StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the the storage class. + /// 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 storageClassName, StorageClassResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _storageClassResourceStorageClassRestClient.CreateOrUpdate(Id, storageClassName, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new StorageClassResourceOperationSource(Client), _storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateCreateOrUpdateRequest(Id, storageClassName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the storage class. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.Get"); + scope.Start(); + try + { + var response = await _storageClassResourceStorageClassRestClient.GetAsync(Id, storageClassName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a StorageClassResource + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the storage class. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.Get"); + scope.Start(); + try + { + var response = _storageClassResourceStorageClassRestClient.Get(Id, storageClassName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List StorageClassResource resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses + /// + /// + /// Operation Id + /// StorageClass_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _storageClassResourceStorageClassRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _storageClassResourceStorageClassRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageClassResource(Client, StorageClassResourceData.DeserializeStorageClassResourceData(e)), _storageClassResourceStorageClassClientDiagnostics, Pipeline, "StorageClassResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List StorageClassResource resources by parent + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses + /// + /// + /// Operation Id + /// StorageClass_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _storageClassResourceStorageClassRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _storageClassResourceStorageClassRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageClassResource(Client, StorageClassResourceData.DeserializeStorageClassResourceData(e)), _storageClassResourceStorageClassClientDiagnostics, Pipeline, "StorageClassResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the storage class. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _storageClassResourceStorageClassRestClient.GetAsync(Id, storageClassName, 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 + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the storage class. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.Exists"); + scope.Start(); + try + { + var response = _storageClassResourceStorageClassRestClient.Get(Id, storageClassName, 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 + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the storage class. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _storageClassResourceStorageClassRestClient.GetAsync(Id, storageClassName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// + /// + /// Operation Id + /// StorageClass_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the the storage class. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string storageClassName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); + + using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _storageClassResourceStorageClassRestClient.Get(Id, storageClassName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new StorageClassResource(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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs new file mode 100644 index 0000000000000..60612b6ea5278 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + public partial class StorageClassResourceData : 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(StorageClassResourceData)} 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(AllowVolumeExpansion)) + { + writer.WritePropertyName("allowVolumeExpansion"u8); + writer.WriteStringValue(AllowVolumeExpansion.Value.ToString()); + } + if (Optional.IsCollectionDefined(MountOptions)) + { + writer.WritePropertyName("mountOptions"u8); + writer.WriteStartArray(); + foreach (var item in MountOptions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Provisioner)) + { + writer.WritePropertyName("provisioner"u8); + writer.WriteStringValue(Provisioner); + } + if (Optional.IsDefined(VolumeBindingMode)) + { + writer.WritePropertyName("volumeBindingMode"u8); + writer.WriteStringValue(VolumeBindingMode.Value.ToString()); + } + if (Optional.IsCollectionDefined(AccessModes)) + { + writer.WritePropertyName("accessModes"u8); + writer.WriteStartArray(); + foreach (var item in AccessModes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataResilience)) + { + writer.WritePropertyName("dataResilience"u8); + writer.WriteStringValue(DataResilience.Value.ToString()); + } + if (Optional.IsDefined(FailoverSpeed)) + { + writer.WritePropertyName("failoverSpeed"u8); + writer.WriteStringValue(FailoverSpeed.Value.ToString()); + } + if (Optional.IsCollectionDefined(Limitations)) + { + writer.WritePropertyName("limitations"u8); + writer.WriteStartArray(); + foreach (var item in Limitations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Performance)) + { + writer.WritePropertyName("performance"u8); + writer.WriteStringValue(Performance.Value.ToString()); + } + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority.Value); + } + if (Optional.IsDefined(TypeProperties)) + { + writer.WritePropertyName("typeProperties"u8); + writer.WriteObjectValue(TypeProperties, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + 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(); + } + + StorageClassResourceData 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(StorageClassResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageClassResourceData(document.RootElement, options); + } + + internal static StorageClassResourceData DeserializeStorageClassResourceData(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; + VolumeExpansion? allowVolumeExpansion = default; + IList mountOptions = default; + string provisioner = default; + VolumeBindingMode? volumeBindingMode = default; + IList accessModes = default; + DataResilienceTier? dataResilience = default; + FailoverTier? failoverSpeed = default; + IList limitations = default; + PerformanceTier? performance = default; + long? priority = default; + StorageClassTypeProperties typeProperties = default; + ProvisioningState? provisioningState = 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("allowVolumeExpansion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowVolumeExpansion = new VolumeExpansion(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("mountOptions"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + mountOptions = array; + continue; + } + if (property0.NameEquals("provisioner"u8)) + { + provisioner = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("volumeBindingMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + volumeBindingMode = new VolumeBindingMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("accessModes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AccessMode(item.GetString())); + } + accessModes = array; + continue; + } + if (property0.NameEquals("dataResilience"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataResilience = new DataResilienceTier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("failoverSpeed"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failoverSpeed = new FailoverTier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("limitations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + limitations = array; + continue; + } + if (property0.NameEquals("performance"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + performance = new PerformanceTier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("priority"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("typeProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + typeProperties = StorageClassTypeProperties.DeserializeStorageClassTypeProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageClassResourceData( + id, + name, + type, + systemData, + allowVolumeExpansion, + mountOptions ?? new ChangeTrackingList(), + provisioner, + volumeBindingMode, + accessModes ?? new ChangeTrackingList(), + dataResilience, + failoverSpeed, + limitations ?? new ChangeTrackingList(), + performance, + priority, + typeProperties, + 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(StorageClassResourceData)} does not support writing '{options.Format}' format."); + } + } + + StorageClassResourceData 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 DeserializeStorageClassResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageClassResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs new file mode 100644 index 0000000000000..80b675183fff4 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs @@ -0,0 +1,130 @@ +// 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.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + /// + /// A class representing the StorageClassResource data model. + /// A StorageClass resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) + /// + public partial class StorageClassResourceData : 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 StorageClassResourceData() + { + MountOptions = new ChangeTrackingList(); + AccessModes = new ChangeTrackingList(); + Limitations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Volume can be expanded or not. + /// Additional mount options. + /// Provisioner name. + /// Binding mode of volumes: Immediate, WaitForFirstConsumer. + /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. + /// Allow single data node failure. + /// Failover speed: NA, Slow, Fast. + /// Limitations of the storage class. + /// Performance tier. + /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. + /// + /// Properties of the StorageClass + /// 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 , , , and . + /// + /// Resource provision state. + /// Keeps track of any properties unknown to the library. + internal StorageClassResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeExpansion? allowVolumeExpansion, IList mountOptions, string provisioner, VolumeBindingMode? volumeBindingMode, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypeProperties typeProperties, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + AllowVolumeExpansion = allowVolumeExpansion; + MountOptions = mountOptions; + Provisioner = provisioner; + VolumeBindingMode = volumeBindingMode; + AccessModes = accessModes; + DataResilience = dataResilience; + FailoverSpeed = failoverSpeed; + Limitations = limitations; + Performance = performance; + Priority = priority; + TypeProperties = typeProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Volume can be expanded or not. + public VolumeExpansion? AllowVolumeExpansion { get; set; } + /// Additional mount options. + public IList MountOptions { get; } + /// Provisioner name. + public string Provisioner { get; set; } + /// Binding mode of volumes: Immediate, WaitForFirstConsumer. + public VolumeBindingMode? VolumeBindingMode { get; set; } + /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. + public IList AccessModes { get; } + /// Allow single data node failure. + public DataResilienceTier? DataResilience { get; set; } + /// Failover speed: NA, Slow, Fast. + public FailoverTier? FailoverSpeed { get; set; } + /// Limitations of the storage class. + public IList Limitations { get; } + /// Performance tier. + public PerformanceTier? Performance { get; set; } + /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. + public long? Priority { get; set; } + /// + /// Properties of the StorageClass + /// 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 , , , and . + /// + public StorageClassTypeProperties TypeProperties { get; set; } + /// Resource provision state. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Properties/AssemblyInfo.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..d9e5604da875f --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("ContainerOrchestratorRuntime")] + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] +[assembly: InternalsVisibleTo("Azure.ResourceManager.ContainerOrchestratorRuntime.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md new file mode 100644 index 0000000000000..b143bda6a0ffa --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md @@ -0,0 +1,57 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml +azure-arm: true +csharp: true +library-name: ContainerOrchestratorRuntime +namespace: Azure.ResourceManager.ContainerOrchestratorRuntime +require: https://github.com/Azure/azure-rest-api-specs/blob/c02b366afa77a3e2a746719cea713b231b4b41bb/specification/kubernetesruntime/resource-manager/readme.md +output-folder: $(this-folder)/Generated +clear-output-folder: true +sample-gen: + output-folder: $(this-folder)/../samples/Generated + clear-output-folder: true +skip-csproj: true +modelerfour: + flatten-payloads: false +use-model-reader-writer: true +tag: package-2024-03-01 + +#mgmt-debug: +# show-serialized-names: true + + + +format-by-name-rules: + 'tenantId': 'uuid' + 'ETag': 'etag' + 'location': 'azure-location' + '*Uri': 'Uri' + '*Uris': 'Uri' + +acronym-mapping: + CPU: Cpu + CPUs: Cpus + Os: OS + Ip: IP + Ips: IPs|ips + ID: Id + IDs: Ids + VM: Vm + VMs: Vms + Vmos: VmOS + VMScaleSet: VmScaleSet + DNS: Dns + VPN: Vpn + NAT: Nat + WAN: Wan + Ipv4: IPv4|ipv4 + Ipv6: IPv6|ipv6 + Ipsec: IPsec|ipsec + SSO: Sso + URI: Uri + Etag: ETag|etag + +``` \ No newline at end of file diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.csproj b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.csproj new file mode 100644 index 0000000000000..46408f1f5435d --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.csproj @@ -0,0 +1,5 @@ + + + + + diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestBase.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestBase.cs new file mode 100644 index 0000000000000..fd46f384e4665 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestBase.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Tests +{ + public class ContainerOrchestratorRuntimeManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected ContainerOrchestratorRuntimeManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected ContainerOrchestratorRuntimeManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestEnvironment.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestEnvironment.cs new file mode 100644 index 0000000000000..e952392ee339f --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Tests +{ + public class ContainerOrchestratorRuntimeManagementTestEnvironment : TestEnvironment + { + } +} \ No newline at end of file diff --git a/sdk/containerorchestratorruntime/ci.mgmt.yml b/sdk/containerorchestratorruntime/ci.mgmt.yml new file mode 100644 index 0000000000000..0a036386143ba --- /dev/null +++ b/sdk/containerorchestratorruntime/ci.mgmt.yml @@ -0,0 +1,23 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: containerorchestratorruntime + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.ContainerOrchestratorRuntime + safeName: AzureResourceManagerContainerOrchestratorRuntime diff --git a/sdk/healthdataaiservices/ci.mgmt.yml b/sdk/healthdataaiservices/ci.mgmt.yml index db009952132c9..016a917c1e19c 100644 --- a/sdk/healthdataaiservices/ci.mgmt.yml +++ b/sdk/healthdataaiservices/ci.mgmt.yml @@ -1,18 +1,17 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none - pr: branches: include: - - main - - feature/* - - hotfix/* - - release/* + - main + - feature/* + - hotfix/* + - release/* paths: include: - - sdk/healthdataaiservices/ci.mgmt.yml - - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 197e7bb13fada..1b2a608a9ef63 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -47,6 +47,7 @@ trigger: - sdk/consumption/Azure.ResourceManager.Consumption - sdk/containerapps/Azure.ResourceManager.AppContainers - sdk/containerinstance/Azure.ResourceManager.ContainerInstance + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry - sdk/containerservice/Azure.ResourceManager.ContainerService - sdk/cosmosdb/Azure.ResourceManager.CosmosDB @@ -245,6 +246,7 @@ pr: - sdk/consumption/Azure.ResourceManager.Consumption - sdk/containerapps/Azure.ResourceManager.AppContainers - sdk/containerinstance/Azure.ResourceManager.ContainerInstance + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry - sdk/containerservice/Azure.ResourceManager.ContainerService - sdk/cosmosdb/Azure.ResourceManager.CosmosDB From 93fabcf2f935a866054a3fa5c8db3a716107c558 Mon Sep 17 00:00:00 2001 From: Xinyu He Date: Fri, 16 Aug 2024 15:28:53 +0800 Subject: [PATCH 02/20] Generate API --- ...ainerOrchestratorRuntime.netstandard2.0.cs | 547 ++++++++++++++++++ 1 file changed, 547 insertions(+) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs new file mode 100644 index 0000000000000..a9f577c12ed3c --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs @@ -0,0 +1,547 @@ +namespace Azure.ResourceManager.ContainerOrchestratorRuntime +{ + public partial class BgpPeerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected BgpPeerCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string bgpPeerName, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string bgpPeerName, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class BgpPeerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BgpPeerData() { } + public int? MyAsn { get { throw null; } set { } } + public string PeerAddress { get { throw null; } set { } } + public int? PeerAsn { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? ProvisioningState { get { throw null; } } + Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData 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 BgpPeerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected BgpPeerResource() { } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string bgpPeerName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class ContainerOrchestratorRuntimeExtensions + { + public static Azure.Response GetBgpPeer(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetBgpPeerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerResource GetBgpPeerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerCollection GetBgpPeers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.Response GetLoadBalancer(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetLoadBalancerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerResource GetLoadBalancerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerCollection GetLoadBalancers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResource GetServiceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetServiceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetServiceResourceAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceCollection GetServiceResources(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResource GetStorageClassResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetStorageClassResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetStorageClassResourceAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceCollection GetStorageClassResources(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + } + public partial class LoadBalancerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected LoadBalancerCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string loadBalancerName, Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string loadBalancerName, Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class LoadBalancerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LoadBalancerData() { } + public System.Collections.Generic.IList Addresses { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode? AdvertiseMode { get { throw null; } set { } } + public System.Collections.Generic.IList BgpPeers { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IDictionary ServiceSelector { get { throw null; } } + Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData 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 LoadBalancerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected LoadBalancerResource() { } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string loadBalancerName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ServiceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServiceResource() { } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string serviceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ServiceResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServiceResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string serviceName, Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string serviceName, Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ServiceResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceResourceData() { } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string RpObjectId { get { throw null; } } + Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData 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 StorageClassResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected StorageClassResource() { } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string storageClassName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class StorageClassResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected StorageClassResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string storageClassName, Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string storageClassName, Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class StorageClassResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageClassResourceData() { } + public System.Collections.Generic.IList AccessModes { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? AllowVolumeExpansion { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? DataResilience { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? FailoverSpeed { get { throw null; } set { } } + public System.Collections.Generic.IList Limitations { get { throw null; } } + public System.Collections.Generic.IList MountOptions { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? Performance { get { throw null; } set { } } + public long? Priority { get { throw null; } set { } } + public string Provisioner { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties TypeProperties { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode? VolumeBindingMode { get { throw null; } set { } } + Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData 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 Azure.ResourceManager.ContainerOrchestratorRuntime.Mocking +{ + public partial class MockableContainerOrchestratorRuntimeArmClient : Azure.ResourceManager.ArmResource + { + protected MockableContainerOrchestratorRuntimeArmClient() { } + public virtual Azure.Response GetBgpPeer(Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBgpPeerAsync(Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerResource GetBgpPeerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerCollection GetBgpPeers(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.Response GetLoadBalancer(Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetLoadBalancerAsync(Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerResource GetLoadBalancerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerCollection GetLoadBalancers(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResource GetServiceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.Response GetServiceResource(Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceResourceAsync(Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceCollection GetServiceResources(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResource GetStorageClassResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.Response GetStorageClassResource(Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetStorageClassResourceAsync(Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceCollection GetStorageClassResources(Azure.Core.ResourceIdentifier scope) { throw null; } + } +} +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AccessMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AccessMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode ReadWriteMany { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode ReadWriteOnce { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AdvertiseMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AdvertiseMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode ARP { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode BGP { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode Both { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode right) { throw null; } + public override string ToString() { throw null; } + } + public static partial class ArmContainerOrchestratorRuntimeModelFactory + { + public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData BgpPeerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? myAsn = default(int?), int? peerAsn = default(int?), string peerAddress = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData LoadBalancerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable addresses = null, System.Collections.Generic.IDictionary serviceSelector = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode? advertiseMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode?), System.Collections.Generic.IEnumerable bgpPeers = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData ServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string rpObjectId = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData StorageClassResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? allowVolumeExpansion = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion?), System.Collections.Generic.IEnumerable mountOptions = null, string provisioner = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode? volumeBindingMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode?), System.Collections.Generic.IEnumerable accessModes = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? dataResilience = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? failoverSpeed = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier?), System.Collections.Generic.IEnumerable limitations = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? performance = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier?), long? priority = default(long?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties typeProperties = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState?)) { throw null; } + } + public partial class BlobStorageClassTypeProperties : Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BlobStorageClassTypeProperties(string azureStorageAccountName, string azureStorageAccountKey) { } + public string AzureStorageAccountKey { get { throw null; } set { } } + public string AzureStorageAccountName { get { throw null; } set { } } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.BlobStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.BlobStorageClassTypeProperties 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 DataResilienceTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataResilienceTier(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier DataResilient { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier NotDataResilient { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FailoverTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FailoverTier(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier Fast { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier NotAvailable { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier Slow { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier Super { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NativeStorageClassTypeProperties : Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NativeStorageClassTypeProperties() { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NativeStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NativeStorageClassTypeProperties 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 NfsDirectoryActionOnVolumeDeletion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NfsDirectoryActionOnVolumeDeletion(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion Delete { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion Retain { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NfsStorageClassTypeProperties : Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NfsStorageClassTypeProperties(string server, string share) { } + public string MountPermissions { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion? OnDelete { get { throw null; } set { } } + public string Server { get { throw null; } set { } } + public string Share { get { throw null; } set { } } + public string SubDir { get { throw null; } set { } } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsStorageClassTypeProperties 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 PerformanceTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PerformanceTier(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier Basic { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier Premium { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier Standard { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier Ultra { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier Undefined { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RwxStorageClassTypeProperties : Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RwxStorageClassTypeProperties(string backingStorageClassName) { } + public string BackingStorageClassName { get { throw null; } set { } } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.RwxStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.RwxStorageClassTypeProperties 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 SmbStorageClassTypeProperties : Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SmbStorageClassTypeProperties(string source) { } + public string Domain { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string Source { get { throw null; } set { } } + public string SubDir { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.SmbStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.SmbStorageClassTypeProperties 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 StorageClassPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageClassPropertiesUpdate() { } + public System.Collections.Generic.IList AccessModes { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? AllowVolumeExpansion { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? DataResilience { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? FailoverSpeed { get { throw null; } set { } } + public System.Collections.Generic.IList Limitations { get { throw null; } } + public System.Collections.Generic.IList MountOptions { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? Performance { get { throw null; } set { } } + public long? Priority { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypePropertiesUpdate TypeProperties { get { throw null; } set { } } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassPropertiesUpdate 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 StorageClassResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageClassResourcePatch() { } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassPropertiesUpdate Properties { get { throw null; } set { } } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassResourcePatch 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 abstract partial class StorageClassTypeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected StorageClassTypeProperties() { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties 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 StorageClassTypePropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageClassTypePropertiesUpdate() { } + public string AzureStorageAccountKey { get { throw null; } set { } } + public string AzureStorageAccountName { get { throw null; } set { } } + public string BackingStorageClassName { get { throw null; } set { } } + public string Domain { get { throw null; } set { } } + public string MountPermissions { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsDirectoryActionOnVolumeDeletion? OnDelete { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string Server { get { throw null; } set { } } + public string Share { get { throw null; } set { } } + public string Source { get { throw null; } set { } } + public string SubDir { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypePropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypePropertiesUpdate 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 VolumeBindingMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VolumeBindingMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode Immediate { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode WaitForFirstConsumer { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VolumeExpansion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VolumeExpansion(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion Allow { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion Disallow { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion right) { throw null; } + public override string ToString() { throw null; } + } +} From 50fc9f3a2ca7c2495e9ab045de605ed76552369c Mon Sep 17 00:00:00 2001 From: Xinyu He Date: Fri, 23 Aug 2024 16:28:54 +0800 Subject: [PATCH 03/20] add load balancer tests --- .../assets.json | 2 +- ....ContainerOrchestratorRuntime.Tests.csproj | 3 ++ .../tests/Scenario/LoadBalancerTests.cs | 42 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json index 83ab1e134a249..aca8596f9c141 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json @@ -1,6 +1,6 @@ { "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", - "TagPrefix": "net//Azure.ResourceManager.ContainerOrchestratorRuntime", + "TagPrefix": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime", "Tag": "" } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.csproj b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.csproj index 46408f1f5435d..c800c6d15be13 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.csproj +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.csproj @@ -2,4 +2,7 @@ + + + diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs new file mode 100644 index 0000000000000..6b0967533048e --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Kubernetes; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.Tests +{ + [TestFixture] + public class LoadBalancerTests : ContainerOrchestratorRuntimeManagementTestBase + { + public LoadBalancerTests() : base(false) + { + } + + [TestCase] + [RecordedTest] + public void CreateLoadBalancer() + { + var connectedCluster = ConnectedClusterResource.CreateResourceIdentifier("b9e38f20-7c9c-4497-a25d-1a0c5eef2108", "xinyuhe-canary", "test-cluster-euap-arc"); + var loadBalancerCollection = new LoadBalancerCollection(Client, connectedCluster); + var loadBalancerData = new LoadBalancerData + { + AdvertiseMode = AdvertiseMode.ARP + }; + loadBalancerData.Addresses.Add("192.168.10.1/32"); + loadBalancerCollection.CreateOrUpdate(WaitUntil.Completed, "testlb", loadBalancerData); + var bgpPeerData = new BgpPeerData + { + MyAsn = 64000, + PeerAsn = 64001, + PeerAddress = "192.168.2.0" + }; + var bgpPeerCollection = new BgpPeerCollection(Client, connectedCluster); + bgpPeerCollection.CreateOrUpdate(WaitUntil.Completed, "testpeer", bgpPeerData); + } + } +} From 2d66a81b1a4024432525717a63a3b63f66be5d33 Mon Sep 17 00:00:00 2001 From: HE Xinyu Date: Wed, 28 Aug 2024 15:07:46 +0800 Subject: [PATCH 04/20] Update CODEOWNERS --- .github/CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d446704467e1f..838252701aa79 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -390,6 +390,9 @@ # ServiceLabel: %Container Service # ServiceOwners: @qike-ms @jwilder @thomas1206 @seanmck +# ServiceLabel: %Container Orchestrator Runtime +/sdk/containerorchestratorruntime/ @HE-Xinyu @ddadaal + # ServiceLabel: %Cosmos /sdk/cosmosdb/ @pjohari-ms @MehaKaushik @shurd @anfeldma-ms @zfoster @kushagraThapar From 8a1b440bd9c31240a0e124405149e6947f7a6a77 Mon Sep 17 00:00:00 2001 From: HE Xinyu Date: Thu, 29 Aug 2024 11:01:25 +0800 Subject: [PATCH 05/20] upload recording --- .../assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json index aca8596f9c141..d3ab3910560f0 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime", - "Tag": "" + "Tag": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime_f5944831d3" } From 404e32751fa01091a2982025ff54dd8434cb555a Mon Sep 17 00:00:00 2001 From: Xinyu He Date: Mon, 2 Sep 2024 13:38:14 +0800 Subject: [PATCH 06/20] fix CODEOWNERS --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 838252701aa79..40e7b77c7af15 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -390,9 +390,6 @@ # ServiceLabel: %Container Service # ServiceOwners: @qike-ms @jwilder @thomas1206 @seanmck -# ServiceLabel: %Container Orchestrator Runtime -/sdk/containerorchestratorruntime/ @HE-Xinyu @ddadaal - # ServiceLabel: %Cosmos /sdk/cosmosdb/ @pjohari-ms @MehaKaushik @shurd @anfeldma-ms @zfoster @kushagraThapar @@ -964,6 +961,9 @@ # PRLabel: %Communication - Resource Manager /sdk/communication/Azure.ResourceManager.Communication/ @archerzz @ArcturusZhang @ArthurMa1978 +# ServiceLabel: %Container Orchestrator Runtime +/sdk/containerorchestratorruntime/ @HE-Xinyu @ddadaal + # PRLabel: %Device Registry /sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ @davidemontanari @atastrophic @marcodalessandro @rohankhandelwal @riteshrao From 86b6d0647ccd1e5696d541b0aa8a107da0705c0c Mon Sep 17 00:00:00 2001 From: Xinyu He Date: Mon, 2 Sep 2024 13:38:32 +0800 Subject: [PATCH 07/20] Storage Class tests --- .../tests/Scenario/StorageClassTests.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs new file mode 100644 index 0000000000000..9e28682387fa7 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; +using Azure.ResourceManager.Kubernetes; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.Tests +{ + [TestFixture] + public class StorageClassTests : ContainerOrchestratorRuntimeManagementTestBase + { + public StorageClassTests() : base(true) + { + } + + [TestCase] + [RecordedTest] + public async Task CreateStorageClassAsync() + { + var connectedCluster = ConnectedClusterResource.CreateResourceIdentifier("b9e38f20-7c9c-4497-a25d-1a0c5eef2108", "xinyuhe-canary", "test-cluster-euap-arc"); + var nfsStorageClassTypeProperties = new NfsStorageClassTypeProperties("172.23.1.4", "/"); + var storageClassData = new StorageClassResourceData + { + TypeProperties = nfsStorageClassTypeProperties + }; + var storageClassCollection = new StorageClassResourceCollection(Client, connectedCluster); + await storageClassCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testsc", storageClassData); + } + } +} From d8442552e8c35ee40997b192ed3a3e848237e751 Mon Sep 17 00:00:00 2001 From: HE Xinyu Date: Mon, 2 Sep 2024 14:54:30 +0800 Subject: [PATCH 08/20] upload test asset --- .../assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json index d3ab3910560f0..1122fb2ac2ded 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime", - "Tag": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime_f5944831d3" + "Tag": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime_2a9647f23d" } From 430c036ff99ddfbce0502de385db99be49e68e35 Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Wed, 4 Sep 2024 15:12:56 -0400 Subject: [PATCH 09/20] Update .github/CODEOWNERS --- .github/CODEOWNERS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 40e7b77c7af15..50f8125628c58 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -961,8 +961,11 @@ # PRLabel: %Communication - Resource Manager /sdk/communication/Azure.ResourceManager.Communication/ @archerzz @ArcturusZhang @ArthurMa1978 +# PRLael: %Container Orchestrator Runtime +/sdk/containerorchestratorruntime/Azure.ResourceManager.*/ @HE-Xinyu @ddadaal + # ServiceLabel: %Container Orchestrator Runtime -/sdk/containerorchestratorruntime/ @HE-Xinyu @ddadaal +# ServiceOwners: @HE-Xinyu @ddadaal # PRLabel: %Device Registry /sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ @davidemontanari @atastrophic @marcodalessandro @rohankhandelwal @riteshrao From 839cee1f197b45da313bbef6bcd157cbd3dd347b Mon Sep 17 00:00:00 2001 From: Junda Chen Date: Thu, 5 Sep 2024 15:34:31 +0800 Subject: [PATCH 10/20] fix --- ...ontainerOrchestratorRuntimeModelFactory.cs | 10 +-- .../Generated/BgpPeerData.Serialization.cs | 4 +- .../src/Generated/BgpPeerData.cs | 4 +- .../LoadBalancerData.Serialization.cs | 4 +- .../src/Generated/LoadBalancerData.cs | 4 +- .../src/Generated/Models/AccessMode.cs | 51 -------------- .../KubernetesRuntimeProvisioningState.cs | 66 +++++++++++++++++++ .../src/Generated/Models/ProvisioningState.cs | 66 ------------------- .../Models/StorageClassAccessMode.cs | 51 ++++++++++++++ ...rageClassPropertiesUpdate.Serialization.cs | 8 +-- .../Models/StorageClassPropertiesUpdate.cs | 6 +- .../ServiceResourceData.Serialization.cs | 14 ++-- .../src/Generated/ServiceResourceData.cs | 6 +- .../StorageClassResourceData.Serialization.cs | 12 ++-- .../src/Generated/StorageClassResourceData.cs | 8 +-- .../src/autorest.md | 11 ++-- .../tests/Scenario/LoadBalancerTests.cs | 2 +- 17 files changed, 167 insertions(+), 160 deletions(-) delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AccessMode.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/KubernetesRuntimeProvisioningState.cs delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassAccessMode.cs diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs index d2664b30532c5..14d462562a4ef 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs @@ -26,7 +26,7 @@ public static partial class ArmContainerOrchestratorRuntimeModelFactory /// Peer Address. /// Resource provision state. /// A new instance for mocking. - public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? myAsn = null, int? peerAsn = null, string peerAddress = null, ProvisioningState? provisioningState = null) + public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? myAsn = null, int? peerAsn = null, string peerAddress = null, KubernetesRuntimeProvisioningState? provisioningState = null) { return new BgpPeerData( id, @@ -51,7 +51,7 @@ public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. /// Resource provision state. /// A new instance for mocking. - public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable addresses = null, IDictionary serviceSelector = null, AdvertiseMode? advertiseMode = null, IEnumerable bgpPeers = null, ProvisioningState? provisioningState = null) + public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable addresses = null, IDictionary serviceSelector = null, AdvertiseMode? advertiseMode = null, IEnumerable bgpPeers = null, KubernetesRuntimeProvisioningState? provisioningState = null) { addresses ??= new List(); serviceSelector ??= new Dictionary(); @@ -78,7 +78,7 @@ public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, st /// The object id of the service principal of the RP provisioned in the tenant. /// Resource provision state. /// A new instance for mocking. - public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string rpObjectId = null, ProvisioningState? provisioningState = null) + public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? rpObjectId = null, KubernetesRuntimeProvisioningState? provisioningState = null) { return new ServiceResourceData( id, @@ -112,10 +112,10 @@ public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = nu /// /// Resource provision state. /// A new instance for mocking. - public static StorageClassResourceData StorageClassResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeExpansion? allowVolumeExpansion = null, IEnumerable mountOptions = null, string provisioner = null, VolumeBindingMode? volumeBindingMode = null, IEnumerable accessModes = null, DataResilienceTier? dataResilience = null, FailoverTier? failoverSpeed = null, IEnumerable limitations = null, PerformanceTier? performance = null, long? priority = null, StorageClassTypeProperties typeProperties = null, ProvisioningState? provisioningState = null) + public static StorageClassResourceData StorageClassResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeExpansion? allowVolumeExpansion = null, IEnumerable mountOptions = null, string provisioner = null, VolumeBindingMode? volumeBindingMode = null, IEnumerable accessModes = null, DataResilienceTier? dataResilience = null, FailoverTier? failoverSpeed = null, IEnumerable limitations = null, PerformanceTier? performance = null, long? priority = null, StorageClassTypeProperties typeProperties = null, KubernetesRuntimeProvisioningState? provisioningState = null) { mountOptions ??= new List(); - accessModes ??= new List(); + accessModes ??= new List(); limitations ??= new List(); return new StorageClassResourceData( diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs index 582a731f0fc0c..f4f89813162b9 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs @@ -116,7 +116,7 @@ internal static BgpPeerData DeserializeBgpPeerData(JsonElement element, ModelRea int? myAsn = default; int? peerAsn = default; string peerAddress = default; - ProvisioningState? provisioningState = default; + KubernetesRuntimeProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -183,7 +183,7 @@ internal static BgpPeerData DeserializeBgpPeerData(JsonElement element, ModelRea { continue; } - provisioningState = new ProvisioningState(property0.Value.GetString()); + provisioningState = new KubernetesRuntimeProvisioningState(property0.Value.GetString()); continue; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs index 797d8499915d0..7a3099dedd450 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs @@ -66,7 +66,7 @@ public BgpPeerData() /// Peer Address. /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal BgpPeerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? myAsn, int? peerAsn, string peerAddress, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal BgpPeerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? myAsn, int? peerAsn, string peerAddress, KubernetesRuntimeProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { MyAsn = myAsn; PeerAsn = peerAsn; @@ -82,6 +82,6 @@ internal BgpPeerData(ResourceIdentifier id, string name, ResourceType resourceTy /// Peer Address. public string PeerAddress { get; set; } /// Resource provision state. - public ProvisioningState? ProvisioningState { get; } + public KubernetesRuntimeProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs index b1cbe1e95b073..eb2b1b8b7727c 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs @@ -138,7 +138,7 @@ internal static LoadBalancerData DeserializeLoadBalancerData(JsonElement element IDictionary serviceSelector = default; AdvertiseMode? advertiseMode = default; IList bgpPeers = default; - ProvisioningState? provisioningState = default; + KubernetesRuntimeProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -233,7 +233,7 @@ internal static LoadBalancerData DeserializeLoadBalancerData(JsonElement element { continue; } - provisioningState = new ProvisioningState(property0.Value.GetString()); + provisioningState = new KubernetesRuntimeProvisioningState(property0.Value.GetString()); continue; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs index 872e3c47602e3..368a140642c3b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs @@ -70,7 +70,7 @@ public LoadBalancerData() /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal LoadBalancerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList addresses, IDictionary serviceSelector, AdvertiseMode? advertiseMode, IList bgpPeers, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal LoadBalancerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList addresses, IDictionary serviceSelector, AdvertiseMode? advertiseMode, IList bgpPeers, KubernetesRuntimeProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Addresses = addresses; ServiceSelector = serviceSelector; @@ -89,6 +89,6 @@ internal LoadBalancerData(ResourceIdentifier id, string name, ResourceType resou /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. public IList BgpPeers { get; } /// Resource provision state. - public ProvisioningState? ProvisioningState { get; } + public KubernetesRuntimeProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AccessMode.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AccessMode.cs deleted file mode 100644 index 30fb6cab18cae..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AccessMode.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.ContainerOrchestratorRuntime.Models -{ - /// Storage Class Access Mode. - public readonly partial struct AccessMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AccessMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ReadWriteOnceValue = "ReadWriteOnce"; - private const string ReadWriteManyValue = "ReadWriteMany"; - - /// Read Write Once (RWO) access mode. - public static AccessMode ReadWriteOnce { get; } = new AccessMode(ReadWriteOnceValue); - /// Read Write Many (RWX) access mode. - public static AccessMode ReadWriteMany { get; } = new AccessMode(ReadWriteManyValue); - /// Determines if two values are the same. - public static bool operator ==(AccessMode left, AccessMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AccessMode left, AccessMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AccessMode(string value) => new AccessMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AccessMode other && Equals(other); - /// - public bool Equals(AccessMode 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/KubernetesRuntimeProvisioningState.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/KubernetesRuntimeProvisioningState.cs new file mode 100644 index 0000000000000..8dcf060d29f45 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/KubernetesRuntimeProvisioningState.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.ContainerOrchestratorRuntime.Models +{ + /// The status of the current operation. + public readonly partial struct KubernetesRuntimeProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KubernetesRuntimeProvisioningState(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 KubernetesRuntimeProvisioningState Succeeded { get; } = new KubernetesRuntimeProvisioningState(SucceededValue); + /// Resource creation failed. + public static KubernetesRuntimeProvisioningState Failed { get; } = new KubernetesRuntimeProvisioningState(FailedValue); + /// Resource creation was canceled. + public static KubernetesRuntimeProvisioningState Canceled { get; } = new KubernetesRuntimeProvisioningState(CanceledValue); + /// Initial provisioning in progress. + public static KubernetesRuntimeProvisioningState Provisioning { get; } = new KubernetesRuntimeProvisioningState(ProvisioningValue); + /// Update in progress. + public static KubernetesRuntimeProvisioningState Updating { get; } = new KubernetesRuntimeProvisioningState(UpdatingValue); + /// Deletion in progress. + public static KubernetesRuntimeProvisioningState Deleting { get; } = new KubernetesRuntimeProvisioningState(DeletingValue); + /// Change accepted for processing. + public static KubernetesRuntimeProvisioningState Accepted { get; } = new KubernetesRuntimeProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(KubernetesRuntimeProvisioningState left, KubernetesRuntimeProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KubernetesRuntimeProvisioningState left, KubernetesRuntimeProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator KubernetesRuntimeProvisioningState(string value) => new KubernetesRuntimeProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KubernetesRuntimeProvisioningState other && Equals(other); + /// + public bool Equals(KubernetesRuntimeProvisioningState 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ProvisioningState.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ProvisioningState.cs deleted file mode 100644 index 667c04870245b..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ProvisioningState.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.ContainerOrchestratorRuntime.Models -{ - /// The status of the current operation. - 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); - /// Initial provisioning in progress. - public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); - /// Update in progress. - public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); - /// Deletion in progress. - public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); - /// Change accepted for processing. - 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassAccessMode.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassAccessMode.cs new file mode 100644 index 0000000000000..2d224cd4d4b48 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassAccessMode.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.ContainerOrchestratorRuntime.Models +{ + /// Storage Class Access Mode. + public readonly partial struct StorageClassAccessMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageClassAccessMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadWriteOnceValue = "ReadWriteOnce"; + private const string ReadWriteManyValue = "ReadWriteMany"; + + /// Read Write Once (RWO) access mode. + public static StorageClassAccessMode ReadWriteOnce { get; } = new StorageClassAccessMode(ReadWriteOnceValue); + /// Read Write Many (RWX) access mode. + public static StorageClassAccessMode ReadWriteMany { get; } = new StorageClassAccessMode(ReadWriteManyValue); + /// Determines if two values are the same. + public static bool operator ==(StorageClassAccessMode left, StorageClassAccessMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageClassAccessMode left, StorageClassAccessMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StorageClassAccessMode(string value) => new StorageClassAccessMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StorageClassAccessMode other && Equals(other); + /// + public bool Equals(StorageClassAccessMode 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs index eef3c4e42537b..a474a95439176 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs @@ -126,7 +126,7 @@ internal static StorageClassPropertiesUpdate DeserializeStorageClassPropertiesUp } VolumeExpansion? allowVolumeExpansion = default; IList mountOptions = default; - IList accessModes = default; + IList accessModes = default; DataResilienceTier? dataResilience = default; FailoverTier? failoverSpeed = default; IList limitations = default; @@ -166,10 +166,10 @@ internal static StorageClassPropertiesUpdate DeserializeStorageClassPropertiesUp { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(new AccessMode(item.GetString())); + array.Add(new StorageClassAccessMode(item.GetString())); } accessModes = array; continue; @@ -242,7 +242,7 @@ internal static StorageClassPropertiesUpdate DeserializeStorageClassPropertiesUp return new StorageClassPropertiesUpdate( allowVolumeExpansion, mountOptions ?? new ChangeTrackingList(), - accessModes ?? new ChangeTrackingList(), + accessModes ?? new ChangeTrackingList(), dataResilience, failoverSpeed, limitations ?? new ChangeTrackingList(), diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.cs index 5a2ce1d881bb5..16e8bfd14f42d 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.cs @@ -49,7 +49,7 @@ public partial class StorageClassPropertiesUpdate public StorageClassPropertiesUpdate() { MountOptions = new ChangeTrackingList(); - AccessModes = new ChangeTrackingList(); + AccessModes = new ChangeTrackingList(); Limitations = new ChangeTrackingList(); } @@ -64,7 +64,7 @@ public StorageClassPropertiesUpdate() /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. /// New storage class type of storageClass. /// Keeps track of any properties unknown to the library. - internal StorageClassPropertiesUpdate(VolumeExpansion? allowVolumeExpansion, IList mountOptions, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypePropertiesUpdate typeProperties, IDictionary serializedAdditionalRawData) + internal StorageClassPropertiesUpdate(VolumeExpansion? allowVolumeExpansion, IList mountOptions, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypePropertiesUpdate typeProperties, IDictionary serializedAdditionalRawData) { AllowVolumeExpansion = allowVolumeExpansion; MountOptions = mountOptions; @@ -83,7 +83,7 @@ internal StorageClassPropertiesUpdate(VolumeExpansion? allowVolumeExpansion, ILi /// Additional mount options. public IList MountOptions { get; } /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. - public IList AccessModes { get; } + public IList AccessModes { get; } /// Allow single data node failure. public DataResilienceTier? DataResilience { get; set; } /// Failover speed: NA, Slow, Fast. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs index 7a5b36d4d2dac..68963941c8617 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs @@ -53,7 +53,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri if (options.Format != "W" && Optional.IsDefined(RpObjectId)) { writer.WritePropertyName("rpObjectId"u8); - writer.WriteStringValue(RpObjectId); + writer.WriteStringValue(RpObjectId.Value); } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { @@ -103,8 +103,8 @@ internal static ServiceResourceData DeserializeServiceResourceData(JsonElement e string name = default; ResourceType type = default; SystemData systemData = default; - string rpObjectId = default; - ProvisioningState? provisioningState = default; + Guid? rpObjectId = default; + KubernetesRuntimeProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,11 @@ internal static ServiceResourceData DeserializeServiceResourceData(JsonElement e { if (property0.NameEquals("rpObjectId"u8)) { - rpObjectId = property0.Value.GetString(); + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rpObjectId = property0.Value.GetGuid(); continue; } if (property0.NameEquals("provisioningState"u8)) @@ -153,7 +157,7 @@ internal static ServiceResourceData DeserializeServiceResourceData(JsonElement e { continue; } - provisioningState = new ProvisioningState(property0.Value.GetString()); + provisioningState = new KubernetesRuntimeProvisioningState(property0.Value.GetString()); continue; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs index b5d1caa805142..e193bb4ea1b43 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs @@ -64,7 +64,7 @@ public ServiceResourceData() /// The object id of the service principal of the RP provisioned in the tenant. /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal ServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string rpObjectId, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? rpObjectId, KubernetesRuntimeProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { RpObjectId = rpObjectId; ProvisioningState = provisioningState; @@ -72,8 +72,8 @@ internal ServiceResourceData(ResourceIdentifier id, string name, ResourceType re } /// The object id of the service principal of the RP provisioned in the tenant. - public string RpObjectId { get; } + public Guid? RpObjectId { get; } /// Resource provision state. - public ProvisioningState? ProvisioningState { get; } + public KubernetesRuntimeProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs index 60612b6ea5278..5b2f807ac4b8f 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs @@ -172,14 +172,14 @@ internal static StorageClassResourceData DeserializeStorageClassResourceData(Jso IList mountOptions = default; string provisioner = default; VolumeBindingMode? volumeBindingMode = default; - IList accessModes = default; + IList accessModes = default; DataResilienceTier? dataResilience = default; FailoverTier? failoverSpeed = default; IList limitations = default; PerformanceTier? performance = default; long? priority = default; StorageClassTypeProperties typeProperties = default; - ProvisioningState? provisioningState = default; + KubernetesRuntimeProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -260,10 +260,10 @@ internal static StorageClassResourceData DeserializeStorageClassResourceData(Jso { continue; } - List array = new List(); + List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { - array.Add(new AccessMode(item.GetString())); + array.Add(new StorageClassAccessMode(item.GetString())); } accessModes = array; continue; @@ -333,7 +333,7 @@ internal static StorageClassResourceData DeserializeStorageClassResourceData(Jso { continue; } - provisioningState = new ProvisioningState(property0.Value.GetString()); + provisioningState = new KubernetesRuntimeProvisioningState(property0.Value.GetString()); continue; } } @@ -354,7 +354,7 @@ internal static StorageClassResourceData DeserializeStorageClassResourceData(Jso mountOptions ?? new ChangeTrackingList(), provisioner, volumeBindingMode, - accessModes ?? new ChangeTrackingList(), + accessModes ?? new ChangeTrackingList(), dataResilience, failoverSpeed, limitations ?? new ChangeTrackingList(), diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs index 80b675183fff4..df27f8068fb2b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs @@ -55,7 +55,7 @@ public partial class StorageClassResourceData : ResourceData public StorageClassResourceData() { MountOptions = new ChangeTrackingList(); - AccessModes = new ChangeTrackingList(); + AccessModes = new ChangeTrackingList(); Limitations = new ChangeTrackingList(); } @@ -81,7 +81,7 @@ public StorageClassResourceData() /// /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal StorageClassResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeExpansion? allowVolumeExpansion, IList mountOptions, string provisioner, VolumeBindingMode? volumeBindingMode, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypeProperties typeProperties, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal StorageClassResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeExpansion? allowVolumeExpansion, IList mountOptions, string provisioner, VolumeBindingMode? volumeBindingMode, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypeProperties typeProperties, KubernetesRuntimeProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { AllowVolumeExpansion = allowVolumeExpansion; MountOptions = mountOptions; @@ -107,7 +107,7 @@ internal StorageClassResourceData(ResourceIdentifier id, string name, ResourceTy /// Binding mode of volumes: Immediate, WaitForFirstConsumer. public VolumeBindingMode? VolumeBindingMode { get; set; } /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. - public IList AccessModes { get; } + public IList AccessModes { get; } /// Allow single data node failure. public DataResilienceTier? DataResilience { get; set; } /// Failover speed: NA, Slow, Fast. @@ -125,6 +125,6 @@ internal StorageClassResourceData(ResourceIdentifier id, string name, ResourceTy /// public StorageClassTypeProperties TypeProperties { get; set; } /// Resource provision state. - public ProvisioningState? ProvisioningState { get; } + public KubernetesRuntimeProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md index b143bda6a0ffa..54692f05f494b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md @@ -19,10 +19,13 @@ modelerfour: use-model-reader-writer: true tag: package-2024-03-01 -#mgmt-debug: -# show-serialized-names: true +# mgmt-debug: +# show-serialized-names: true - +rename-mapping: + ServiceResource.properties.rpObjectId: -|uuid + ProvisioningState: KubernetesRuntimeProvisioningState + AccessMode: StorageClassAccessMode format-by-name-rules: 'tenantId': 'uuid' @@ -54,4 +57,4 @@ acronym-mapping: URI: Uri Etag: ETag|etag -``` \ No newline at end of file +``` diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs index 6b0967533048e..59004840c2a0d 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs @@ -19,7 +19,7 @@ public LoadBalancerTests() : base(false) [TestCase] [RecordedTest] - public void CreateLoadBalancer() + public async Task CreateLoadBalancer() { var connectedCluster = ConnectedClusterResource.CreateResourceIdentifier("b9e38f20-7c9c-4497-a25d-1a0c5eef2108", "xinyuhe-canary", "test-cluster-euap-arc"); var loadBalancerCollection = new LoadBalancerCollection(Client, connectedCluster); From b6d432b1d0bff4a710c968e8ef7416f018d7ab76 Mon Sep 17 00:00:00 2001 From: Junda Chen Date: Thu, 5 Sep 2024 15:41:54 +0800 Subject: [PATCH 11/20] fix provisioningstate name --- ...ontainerOrchestratorRuntimeModelFactory.cs | 8 +-- .../Generated/BgpPeerData.Serialization.cs | 4 +- .../src/Generated/BgpPeerData.cs | 4 +- .../LoadBalancerData.Serialization.cs | 4 +- .../src/Generated/LoadBalancerData.cs | 4 +- .../ContainerOrchestratorProvisioningState.cs | 66 +++++++++++++++++++ .../KubernetesRuntimeProvisioningState.cs | 66 ------------------- .../ServiceResourceData.Serialization.cs | 4 +- .../src/Generated/ServiceResourceData.cs | 4 +- .../StorageClassResourceData.Serialization.cs | 4 +- .../src/Generated/StorageClassResourceData.cs | 4 +- .../src/autorest.md | 2 +- 12 files changed, 87 insertions(+), 87 deletions(-) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ContainerOrchestratorProvisioningState.cs delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/KubernetesRuntimeProvisioningState.cs diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs index 14d462562a4ef..b1801291e94f8 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs @@ -26,7 +26,7 @@ public static partial class ArmContainerOrchestratorRuntimeModelFactory /// Peer Address. /// Resource provision state. /// A new instance for mocking. - public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? myAsn = null, int? peerAsn = null, string peerAddress = null, KubernetesRuntimeProvisioningState? provisioningState = null) + public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? myAsn = null, int? peerAsn = null, string peerAddress = null, ContainerOrchestratorProvisioningState? provisioningState = null) { return new BgpPeerData( id, @@ -51,7 +51,7 @@ public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. /// Resource provision state. /// A new instance for mocking. - public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable addresses = null, IDictionary serviceSelector = null, AdvertiseMode? advertiseMode = null, IEnumerable bgpPeers = null, KubernetesRuntimeProvisioningState? provisioningState = null) + public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable addresses = null, IDictionary serviceSelector = null, AdvertiseMode? advertiseMode = null, IEnumerable bgpPeers = null, ContainerOrchestratorProvisioningState? provisioningState = null) { addresses ??= new List(); serviceSelector ??= new Dictionary(); @@ -78,7 +78,7 @@ public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, st /// The object id of the service principal of the RP provisioned in the tenant. /// Resource provision state. /// A new instance for mocking. - public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? rpObjectId = null, KubernetesRuntimeProvisioningState? provisioningState = null) + public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? rpObjectId = null, ContainerOrchestratorProvisioningState? provisioningState = null) { return new ServiceResourceData( id, @@ -112,7 +112,7 @@ public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = nu /// /// Resource provision state. /// A new instance for mocking. - public static StorageClassResourceData StorageClassResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeExpansion? allowVolumeExpansion = null, IEnumerable mountOptions = null, string provisioner = null, VolumeBindingMode? volumeBindingMode = null, IEnumerable accessModes = null, DataResilienceTier? dataResilience = null, FailoverTier? failoverSpeed = null, IEnumerable limitations = null, PerformanceTier? performance = null, long? priority = null, StorageClassTypeProperties typeProperties = null, KubernetesRuntimeProvisioningState? provisioningState = null) + public static StorageClassResourceData StorageClassResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeExpansion? allowVolumeExpansion = null, IEnumerable mountOptions = null, string provisioner = null, VolumeBindingMode? volumeBindingMode = null, IEnumerable accessModes = null, DataResilienceTier? dataResilience = null, FailoverTier? failoverSpeed = null, IEnumerable limitations = null, PerformanceTier? performance = null, long? priority = null, StorageClassTypeProperties typeProperties = null, ContainerOrchestratorProvisioningState? provisioningState = null) { mountOptions ??= new List(); accessModes ??= new List(); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs index f4f89813162b9..d97dcbbb2627e 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs @@ -116,7 +116,7 @@ internal static BgpPeerData DeserializeBgpPeerData(JsonElement element, ModelRea int? myAsn = default; int? peerAsn = default; string peerAddress = default; - KubernetesRuntimeProvisioningState? provisioningState = default; + ContainerOrchestratorProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -183,7 +183,7 @@ internal static BgpPeerData DeserializeBgpPeerData(JsonElement element, ModelRea { continue; } - provisioningState = new KubernetesRuntimeProvisioningState(property0.Value.GetString()); + provisioningState = new ContainerOrchestratorProvisioningState(property0.Value.GetString()); continue; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs index 7a3099dedd450..defc732a66b73 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs @@ -66,7 +66,7 @@ public BgpPeerData() /// Peer Address. /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal BgpPeerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? myAsn, int? peerAsn, string peerAddress, KubernetesRuntimeProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal BgpPeerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? myAsn, int? peerAsn, string peerAddress, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { MyAsn = myAsn; PeerAsn = peerAsn; @@ -82,6 +82,6 @@ internal BgpPeerData(ResourceIdentifier id, string name, ResourceType resourceTy /// Peer Address. public string PeerAddress { get; set; } /// Resource provision state. - public KubernetesRuntimeProvisioningState? ProvisioningState { get; } + public ContainerOrchestratorProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs index eb2b1b8b7727c..bcdc8383751dc 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs @@ -138,7 +138,7 @@ internal static LoadBalancerData DeserializeLoadBalancerData(JsonElement element IDictionary serviceSelector = default; AdvertiseMode? advertiseMode = default; IList bgpPeers = default; - KubernetesRuntimeProvisioningState? provisioningState = default; + ContainerOrchestratorProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -233,7 +233,7 @@ internal static LoadBalancerData DeserializeLoadBalancerData(JsonElement element { continue; } - provisioningState = new KubernetesRuntimeProvisioningState(property0.Value.GetString()); + provisioningState = new ContainerOrchestratorProvisioningState(property0.Value.GetString()); continue; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs index 368a140642c3b..b30ceca98d68a 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs @@ -70,7 +70,7 @@ public LoadBalancerData() /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal LoadBalancerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList addresses, IDictionary serviceSelector, AdvertiseMode? advertiseMode, IList bgpPeers, KubernetesRuntimeProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal LoadBalancerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList addresses, IDictionary serviceSelector, AdvertiseMode? advertiseMode, IList bgpPeers, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Addresses = addresses; ServiceSelector = serviceSelector; @@ -89,6 +89,6 @@ internal LoadBalancerData(ResourceIdentifier id, string name, ResourceType resou /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. public IList BgpPeers { get; } /// Resource provision state. - public KubernetesRuntimeProvisioningState? ProvisioningState { get; } + public ContainerOrchestratorProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ContainerOrchestratorProvisioningState.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ContainerOrchestratorProvisioningState.cs new file mode 100644 index 0000000000000..e80281532b9a3 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ContainerOrchestratorProvisioningState.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.ContainerOrchestratorRuntime.Models +{ + /// The status of the current operation. + public readonly partial struct ContainerOrchestratorProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerOrchestratorProvisioningState(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 ContainerOrchestratorProvisioningState Succeeded { get; } = new ContainerOrchestratorProvisioningState(SucceededValue); + /// Resource creation failed. + public static ContainerOrchestratorProvisioningState Failed { get; } = new ContainerOrchestratorProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ContainerOrchestratorProvisioningState Canceled { get; } = new ContainerOrchestratorProvisioningState(CanceledValue); + /// Initial provisioning in progress. + public static ContainerOrchestratorProvisioningState Provisioning { get; } = new ContainerOrchestratorProvisioningState(ProvisioningValue); + /// Update in progress. + public static ContainerOrchestratorProvisioningState Updating { get; } = new ContainerOrchestratorProvisioningState(UpdatingValue); + /// Deletion in progress. + public static ContainerOrchestratorProvisioningState Deleting { get; } = new ContainerOrchestratorProvisioningState(DeletingValue); + /// Change accepted for processing. + public static ContainerOrchestratorProvisioningState Accepted { get; } = new ContainerOrchestratorProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerOrchestratorProvisioningState left, ContainerOrchestratorProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerOrchestratorProvisioningState left, ContainerOrchestratorProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ContainerOrchestratorProvisioningState(string value) => new ContainerOrchestratorProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerOrchestratorProvisioningState other && Equals(other); + /// + public bool Equals(ContainerOrchestratorProvisioningState 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/KubernetesRuntimeProvisioningState.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/KubernetesRuntimeProvisioningState.cs deleted file mode 100644 index 8dcf060d29f45..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/KubernetesRuntimeProvisioningState.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.ContainerOrchestratorRuntime.Models -{ - /// The status of the current operation. - public readonly partial struct KubernetesRuntimeProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public KubernetesRuntimeProvisioningState(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 KubernetesRuntimeProvisioningState Succeeded { get; } = new KubernetesRuntimeProvisioningState(SucceededValue); - /// Resource creation failed. - public static KubernetesRuntimeProvisioningState Failed { get; } = new KubernetesRuntimeProvisioningState(FailedValue); - /// Resource creation was canceled. - public static KubernetesRuntimeProvisioningState Canceled { get; } = new KubernetesRuntimeProvisioningState(CanceledValue); - /// Initial provisioning in progress. - public static KubernetesRuntimeProvisioningState Provisioning { get; } = new KubernetesRuntimeProvisioningState(ProvisioningValue); - /// Update in progress. - public static KubernetesRuntimeProvisioningState Updating { get; } = new KubernetesRuntimeProvisioningState(UpdatingValue); - /// Deletion in progress. - public static KubernetesRuntimeProvisioningState Deleting { get; } = new KubernetesRuntimeProvisioningState(DeletingValue); - /// Change accepted for processing. - public static KubernetesRuntimeProvisioningState Accepted { get; } = new KubernetesRuntimeProvisioningState(AcceptedValue); - /// Determines if two values are the same. - public static bool operator ==(KubernetesRuntimeProvisioningState left, KubernetesRuntimeProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(KubernetesRuntimeProvisioningState left, KubernetesRuntimeProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator KubernetesRuntimeProvisioningState(string value) => new KubernetesRuntimeProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is KubernetesRuntimeProvisioningState other && Equals(other); - /// - public bool Equals(KubernetesRuntimeProvisioningState 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs index 68963941c8617..9a28ad461090b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs @@ -104,7 +104,7 @@ internal static ServiceResourceData DeserializeServiceResourceData(JsonElement e ResourceType type = default; SystemData systemData = default; Guid? rpObjectId = default; - KubernetesRuntimeProvisioningState? provisioningState = default; + ContainerOrchestratorProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -157,7 +157,7 @@ internal static ServiceResourceData DeserializeServiceResourceData(JsonElement e { continue; } - provisioningState = new KubernetesRuntimeProvisioningState(property0.Value.GetString()); + provisioningState = new ContainerOrchestratorProvisioningState(property0.Value.GetString()); continue; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs index e193bb4ea1b43..223211e14c7dd 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs @@ -64,7 +64,7 @@ public ServiceResourceData() /// The object id of the service principal of the RP provisioned in the tenant. /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal ServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? rpObjectId, KubernetesRuntimeProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? rpObjectId, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { RpObjectId = rpObjectId; ProvisioningState = provisioningState; @@ -74,6 +74,6 @@ internal ServiceResourceData(ResourceIdentifier id, string name, ResourceType re /// The object id of the service principal of the RP provisioned in the tenant. public Guid? RpObjectId { get; } /// Resource provision state. - public KubernetesRuntimeProvisioningState? ProvisioningState { get; } + public ContainerOrchestratorProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs index 5b2f807ac4b8f..9cb097fd6066c 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs @@ -179,7 +179,7 @@ internal static StorageClassResourceData DeserializeStorageClassResourceData(Jso PerformanceTier? performance = default; long? priority = default; StorageClassTypeProperties typeProperties = default; - KubernetesRuntimeProvisioningState? provisioningState = default; + ContainerOrchestratorProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -333,7 +333,7 @@ internal static StorageClassResourceData DeserializeStorageClassResourceData(Jso { continue; } - provisioningState = new KubernetesRuntimeProvisioningState(property0.Value.GetString()); + provisioningState = new ContainerOrchestratorProvisioningState(property0.Value.GetString()); continue; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs index df27f8068fb2b..f692ea5d803ad 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs @@ -81,7 +81,7 @@ public StorageClassResourceData() /// /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal StorageClassResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeExpansion? allowVolumeExpansion, IList mountOptions, string provisioner, VolumeBindingMode? volumeBindingMode, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypeProperties typeProperties, KubernetesRuntimeProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal StorageClassResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeExpansion? allowVolumeExpansion, IList mountOptions, string provisioner, VolumeBindingMode? volumeBindingMode, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypeProperties typeProperties, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { AllowVolumeExpansion = allowVolumeExpansion; MountOptions = mountOptions; @@ -125,6 +125,6 @@ internal StorageClassResourceData(ResourceIdentifier id, string name, ResourceTy /// public StorageClassTypeProperties TypeProperties { get; set; } /// Resource provision state. - public KubernetesRuntimeProvisioningState? ProvisioningState { get; } + public ContainerOrchestratorProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md index 54692f05f494b..dd130c0be8458 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md @@ -24,7 +24,7 @@ tag: package-2024-03-01 rename-mapping: ServiceResource.properties.rpObjectId: -|uuid - ProvisioningState: KubernetesRuntimeProvisioningState + ProvisioningState: ContainerOrchestratorProvisioningState AccessMode: StorageClassAccessMode format-by-name-rules: From e5645474de0f6bdebc8be50e5dbeb545122ed335 Mon Sep 17 00:00:00 2001 From: HE Xinyu Date: Fri, 6 Sep 2024 16:42:39 +0800 Subject: [PATCH 12/20] use test environments --- ...inerOrchestratorRuntimeManagementTestEnvironment.cs | 3 +++ .../tests/Scenario/LoadBalancerTests.cs | 10 ++++++---- .../tests/Scenario/StorageClassTests.cs | 3 +-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestEnvironment.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestEnvironment.cs index e952392ee339f..f8e3a70ef9ea6 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestEnvironment.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/ContainerOrchestratorRuntimeManagementTestEnvironment.cs @@ -1,11 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Azure.Core; using Azure.Core.TestFramework; +using Azure.ResourceManager.Kubernetes; namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Tests { public class ContainerOrchestratorRuntimeManagementTestEnvironment : TestEnvironment { + public ResourceIdentifier ConnectedCluster = ConnectedClusterResource.CreateResourceIdentifier("b9e38f20-7c9c-4497-a25d-1a0c5eef2108", "xinyuhe-canary", "test-cluster-euap-arc"); } } \ No newline at end of file diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs index 59004840c2a0d..ae752f982e940 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs @@ -2,8 +2,10 @@ // Licensed under the MIT License. using System.Collections.Generic; +using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; +using Azure.ResourceManager.ContainerOrchestratorRuntime.Mocking; using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; using Azure.ResourceManager.Kubernetes; using NUnit.Framework; @@ -13,13 +15,13 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.Tests [TestFixture] public class LoadBalancerTests : ContainerOrchestratorRuntimeManagementTestBase { - public LoadBalancerTests() : base(false) + public LoadBalancerTests() : base(true) { } [TestCase] [RecordedTest] - public async Task CreateLoadBalancer() + public async Task CreateLoadBalancerAsync() { var connectedCluster = ConnectedClusterResource.CreateResourceIdentifier("b9e38f20-7c9c-4497-a25d-1a0c5eef2108", "xinyuhe-canary", "test-cluster-euap-arc"); var loadBalancerCollection = new LoadBalancerCollection(Client, connectedCluster); @@ -28,7 +30,7 @@ public async Task CreateLoadBalancer() AdvertiseMode = AdvertiseMode.ARP }; loadBalancerData.Addresses.Add("192.168.10.1/32"); - loadBalancerCollection.CreateOrUpdate(WaitUntil.Completed, "testlb", loadBalancerData); + await loadBalancerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testlb", loadBalancerData); var bgpPeerData = new BgpPeerData { MyAsn = 64000, @@ -36,7 +38,7 @@ public async Task CreateLoadBalancer() PeerAddress = "192.168.2.0" }; var bgpPeerCollection = new BgpPeerCollection(Client, connectedCluster); - bgpPeerCollection.CreateOrUpdate(WaitUntil.Completed, "testpeer", bgpPeerData); + await bgpPeerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testpeer", bgpPeerData); } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs index 9e28682387fa7..21f3afde8029e 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs @@ -22,13 +22,12 @@ public StorageClassTests() : base(true) [RecordedTest] public async Task CreateStorageClassAsync() { - var connectedCluster = ConnectedClusterResource.CreateResourceIdentifier("b9e38f20-7c9c-4497-a25d-1a0c5eef2108", "xinyuhe-canary", "test-cluster-euap-arc"); var nfsStorageClassTypeProperties = new NfsStorageClassTypeProperties("172.23.1.4", "/"); var storageClassData = new StorageClassResourceData { TypeProperties = nfsStorageClassTypeProperties }; - var storageClassCollection = new StorageClassResourceCollection(Client, connectedCluster); + var storageClassCollection = new StorageClassResourceCollection(Client, TestEnvironment.ConnectedCluster); await storageClassCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testsc", storageClassData); } } From bc4f2594614039ed5de7d573a55d9a432970cf6f Mon Sep 17 00:00:00 2001 From: HE Xinyu Date: Fri, 6 Sep 2024 16:46:52 +0800 Subject: [PATCH 13/20] submit tests --- .../assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json index 1122fb2ac2ded..356e06acb56b3 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime", - "Tag": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime_2a9647f23d" + "Tag": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime_e71421141e" } From 4d86bf500ec044452ba90014512b97f0c335cc22 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Wed, 11 Sep 2024 11:11:42 +0800 Subject: [PATCH 14/20] update --- .../src/{autorest.md => autorest.md.bak} | 0 .../tsp-location.yaml | 3 +++ 2 files changed, 3 insertions(+) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/{autorest.md => autorest.md.bak} (100%) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md.bak similarity index 100% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md.bak diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml new file mode 100644 index 0000000000000..a5e8121d866fc --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification\kubernetesruntime\KubernetesRuntime.Management +commit: 51bf99aaafdbb7844087f0e1d4eb05dd74b86e77 +repo: ArthurMa1978/azure-rest-api-specs \ No newline at end of file From 7a4a50a8082edce50464f3959b03975e9d047b43 Mon Sep 17 00:00:00 2001 From: HE Xinyu Date: Fri, 13 Sep 2024 15:42:02 +0800 Subject: [PATCH 15/20] add deletion test --- .../assets.json | 2 +- .../tests/Scenario/LoadBalancerTests.cs | 6 ++++-- .../tests/Scenario/StorageClassTests.cs | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json index 356e06acb56b3..39a2e0d2d0963 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime", - "Tag": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime_e71421141e" + "Tag": "net/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime_2b23157b56" } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs index ae752f982e940..b02deafc2ae74 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs @@ -30,7 +30,8 @@ public async Task CreateLoadBalancerAsync() AdvertiseMode = AdvertiseMode.ARP }; loadBalancerData.Addresses.Add("192.168.10.1/32"); - await loadBalancerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testlb", loadBalancerData); + var loadBalancerResource = await loadBalancerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testlb", loadBalancerData); + await loadBalancerResource.Value.DeleteAsync(WaitUntil.Completed); var bgpPeerData = new BgpPeerData { MyAsn = 64000, @@ -38,7 +39,8 @@ public async Task CreateLoadBalancerAsync() PeerAddress = "192.168.2.0" }; var bgpPeerCollection = new BgpPeerCollection(Client, connectedCluster); - await bgpPeerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testpeer", bgpPeerData); + var bgpPeerResource = await bgpPeerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testpeer", bgpPeerData); + await bgpPeerResource.Value.DeleteAsync(WaitUntil.Completed); } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs index 21f3afde8029e..791c2828fe144 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs @@ -28,7 +28,8 @@ public async Task CreateStorageClassAsync() TypeProperties = nfsStorageClassTypeProperties }; var storageClassCollection = new StorageClassResourceCollection(Client, TestEnvironment.ConnectedCluster); - await storageClassCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testsc", storageClassData); + var storageClassResource = await storageClassCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testsc", storageClassData); + await storageClassResource.Value.DeleteAsync(WaitUntil.Started); } } } From 913cd9b44de472644e58e74fdd76e095e3713701 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 26 Sep 2024 23:46:27 +0800 Subject: [PATCH 16/20] update --- .../README.md | 6 +- ...ainerOrchestratorRuntime.netstandard2.0.cs | 413 +++++++++--------- ...mple_ConnectedClusterBgpPeerCollection.cs} | 44 +- ...Sample_ConnectedClusterBgpPeerResource.cs} | 40 +- ...ConnectedClusterLoadBalancerCollection.cs} | 46 +- ...e_ConnectedClusterLoadBalancerResource.cs} | 42 +- ...mple_ConnectedClusterServiceCollection.cs} | 44 +- ...Sample_ConnectedClusterServiceResource.cs} | 40 +- ...ConnectedClusterStorageClassCollection.cs} | 44 +- ...e_ConnectedClusterStorageClassResource.cs} | 40 +- ...ontainerOrchestratorRuntimeModelFactory.cs | 32 +- .../BgpPeerResource.Serialization.cs | 26 -- ...s => ConnectedClusterBgpPeerCollection.cs} | 130 +++--- ...nectedClusterBgpPeerData.Serialization.cs} | 85 ++-- ...Data.cs => ConnectedClusterBgpPeerData.cs} | 12 +- ...tedClusterBgpPeerResource.Serialization.cs | 26 ++ ....cs => ConnectedClusterBgpPeerResource.cs} | 94 ++-- ...ConnectedClusterLoadBalancerCollection.cs} | 130 +++--- ...dClusterLoadBalancerData.Serialization.cs} | 85 ++-- ...cs => ConnectedClusterLoadBalancerData.cs} | 12 +- ...usterLoadBalancerResource.Serialization.cs | 26 ++ ...> ConnectedClusterLoadBalancerResource.cs} | 94 ++-- ...s => ConnectedClusterServiceCollection.cs} | 134 +++--- ...nectedClusterServiceData.Serialization.cs} | 85 ++-- ...Data.cs => ConnectedClusterServiceData.cs} | 12 +- ...tedClusterServiceResource.Serialization.cs | 26 ++ ....cs => ConnectedClusterServiceResource.cs} | 98 ++--- ...ConnectedClusterStorageClassCollection.cs} | 130 +++--- ...dClusterStorageClassData.Serialization.cs} | 85 ++-- ...cs => ConnectedClusterStorageClassData.cs} | 12 +- ...usterStorageClassResource.Serialization.cs | 26 ++ ...> ConnectedClusterStorageClassResource.cs} | 94 ++-- .../ContainerOrchestratorRuntimeExtensions.cs | 152 +++---- ...leContainerOrchestratorRuntimeArmClient.cs | 128 +++--- .../LoadBalancerResource.Serialization.cs | 26 -- .../BgpPeerOperationSource.cs | 38 -- .../ConnectedClusterBgpPeerOperationSource.cs | 38 ++ ...ectedClusterLoadBalancerOperationSource.cs | 38 ++ ...ectedClusterStorageClassOperationSource.cs | 38 ++ .../LoadBalancerOperationSource.cs | 38 -- .../StorageClassResourceOperationSource.cs | 38 -- .../src/Generated/Models/AdvertiseMode.cs | 8 +- .../Models/BgpPeerListResult.Serialization.cs | 17 +- .../src/Generated/Models/BgpPeerListResult.cs | 6 +- ...torageClassTypeProperties.Serialization.cs | 33 +- .../Models/BlobStorageClassTypeProperties.cs | 8 +- ...ClusterStorageClassPatch.Serialization.cs} | 49 ++- ...s => ConnectedClusterStorageClassPatch.cs} | 10 +- .../LoadBalancerListResult.Serialization.cs | 17 +- .../Models/LoadBalancerListResult.cs | 6 +- ...torageClassTypeProperties.Serialization.cs | 33 +- .../NativeStorageClassTypeProperties.cs | 8 +- ...torageClassTypeProperties.Serialization.cs | 33 +- .../Models/NfsStorageClassTypeProperties.cs | 8 +- ...torageClassTypeProperties.Serialization.cs | 33 +- .../Models/RwxStorageClassTypeProperties.cs | 8 +- .../src/Generated/Models/SCType.cs | 60 --- ...ServiceResourceListResult.Serialization.cs | 17 +- .../Models/ServiceResourceListResult.cs | 6 +- ...torageClassTypeProperties.Serialization.cs | 33 +- .../Models/SmbStorageClassTypeProperties.cs | 8 +- ...rageClassPropertiesUpdate.Serialization.cs | 11 +- ...geClassResourceListResult.Serialization.cs | 17 +- .../Models/StorageClassResourceListResult.cs | 6 +- .../src/Generated/Models/StorageClassType.cs | 60 +++ ...torageClassTypeProperties.Serialization.cs | 13 +- .../Models/StorageClassTypeProperties.cs | 8 +- ...ClassTypePropertiesUpdate.Serialization.cs | 11 +- ...torageClassTypeProperties.Serialization.cs | 33 +- .../UnknownStorageClassTypeProperties.cs | 6 +- .../RestOperations/BgpPeersRestOperations.cs | 24 +- .../LoadBalancersRestOperations.cs | 24 +- .../RestOperations/ServicesRestOperations.cs | 32 +- .../StorageClassRestOperations.cs | 32 +- .../ServiceResource.Serialization.cs | 26 -- .../StorageClassResource.Serialization.cs | 26 -- .../src/Properties/AssemblyInfo.cs | 2 +- .../src/{autorest.md.bak => autorest.md} | 19 +- .../tests/Scenario/LoadBalancerTests.cs | 10 +- .../tests/Scenario/StorageClassTests.cs | 4 +- ...sp-location.yaml => tsp-location.yaml.bak} | 0 81 files changed, 1715 insertions(+), 1797 deletions(-) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/{Sample_BgpPeerCollection.cs => Sample_ConnectedClusterBgpPeerCollection.cs} (82%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/{Sample_BgpPeerResource.cs => Sample_ConnectedClusterBgpPeerResource.cs} (66%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/{Sample_LoadBalancerCollection.cs => Sample_ConnectedClusterLoadBalancerCollection.cs} (81%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/{Sample_LoadBalancerResource.cs => Sample_ConnectedClusterLoadBalancerResource.cs} (64%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/{Sample_ServiceResourceCollection.cs => Sample_ConnectedClusterServiceCollection.cs} (82%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/{Sample_ServiceResource.cs => Sample_ConnectedClusterServiceResource.cs} (65%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/{Sample_StorageClassResourceCollection.cs => Sample_ConnectedClusterStorageClassCollection.cs} (81%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/{Sample_StorageClassResource.cs => Sample_ConnectedClusterStorageClassResource.cs} (65%) delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.Serialization.cs rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{BgpPeerCollection.cs => ConnectedClusterBgpPeerCollection.cs} (65%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{BgpPeerData.Serialization.cs => ConnectedClusterBgpPeerData.Serialization.cs} (69%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{BgpPeerData.cs => ConnectedClusterBgpPeerData.cs} (81%) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerResource.Serialization.cs rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{BgpPeerResource.cs => ConnectedClusterBgpPeerResource.cs} (69%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{LoadBalancerCollection.cs => ConnectedClusterLoadBalancerCollection.cs} (64%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{LoadBalancerData.Serialization.cs => ConnectedClusterLoadBalancerData.Serialization.cs} (75%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{LoadBalancerData.cs => ConnectedClusterLoadBalancerData.cs} (83%) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerResource.Serialization.cs rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{LoadBalancerResource.cs => ConnectedClusterLoadBalancerResource.cs} (68%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{ServiceResourceCollection.cs => ConnectedClusterServiceCollection.cs} (65%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{ServiceResourceData.Serialization.cs => ConnectedClusterServiceData.Serialization.cs} (65%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{ServiceResourceData.cs => ConnectedClusterServiceData.cs} (80%) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceResource.Serialization.cs rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{ServiceResource.cs => ConnectedClusterServiceResource.cs} (70%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{StorageClassResourceCollection.cs => ConnectedClusterStorageClassCollection.cs} (64%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{StorageClassResourceData.Serialization.cs => ConnectedClusterStorageClassData.Serialization.cs} (81%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{StorageClassResourceData.cs => ConnectedClusterStorageClassData.cs} (86%) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassResource.Serialization.cs rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/{StorageClassResource.cs => ConnectedClusterStorageClassResource.cs} (67%) delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.Serialization.cs delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/BgpPeerOperationSource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterBgpPeerOperationSource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterLoadBalancerOperationSource.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterStorageClassOperationSource.cs delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/LoadBalancerOperationSource.cs delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/StorageClassResourceOperationSource.cs rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/{StorageClassResourcePatch.Serialization.cs => ConnectedClusterStorageClassPatch.Serialization.cs} (57%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/{StorageClassResourcePatch.cs => ConnectedClusterStorageClassPatch.cs} (81%) delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SCType.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassType.cs delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.Serialization.cs delete mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.Serialization.cs rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/{autorest.md.bak => autorest.md} (77%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/{tsp-location.yaml => tsp-location.yaml.bak} (100%) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md index 8a3e385664afd..fc43b515f6722 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md @@ -1,6 +1,6 @@ -# Microsoft Azure ContainerOrchestratorRuntime management client library for .NET +# Microsoft Azure Container Orchestrator Runtime management client library for .NET -**[Describe the service briefly first.]** +AKS on Azure Stack HCI 23H2 uses Azure Arc to create new Kubernetes clusters on Azure Stack HCI directly from Azure. It enables you to use familiar tools like the Azure portal, Azure CLI, and Azure Resource Manager templates to create and manage your Kubernetes clusters running on Azure Stack HCI. Since clusters are automatically connected to Arc when they are created, you can use your Microsoft Entra ID for connecting to your clusters from anywhere. This ensures your developers and application operators can provision and configure Kubernetes clusters in accordance with company policies. This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: @@ -14,7 +14,7 @@ This library follows the [new Azure SDK guidelines](https://azure.github.io/azur ### Install the package -Install the Microsoft Azure ContainerOrchestratorRuntime management library for .NET with [NuGet](https://www.nuget.org/): +Install the Microsoft Azure Container Orchestrator Runtime management library for .NET with [NuGet](https://www.nuget.org/): ```dotnetcli dotnet add package Azure.ResourceManager.ContainerOrchestratorRuntime --prerelease diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs index a9f577c12ed3c..bfe524ed0069c 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs @@ -23,7 +23,8 @@ public BgpPeerData() { } public int? MyAsn { get { throw null; } set { } } public string PeerAddress { get { throw null; } set { } } public int? PeerAsn { get { throw null; } set { } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -49,162 +50,126 @@ protected BgpPeerResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } - public static partial class ContainerOrchestratorRuntimeExtensions + public partial class ConnectedClusterLoadBalancerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { - public static Azure.Response GetBgpPeer(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetBgpPeerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerResource GetBgpPeerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerCollection GetBgpPeers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } - public static Azure.Response GetLoadBalancer(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetLoadBalancerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerResource GetLoadBalancerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerCollection GetLoadBalancers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResource GetServiceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.Response GetServiceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetServiceResourceAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceCollection GetServiceResources(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResource GetStorageClassResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.Response GetStorageClassResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetStorageClassResourceAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceCollection GetStorageClassResources(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } - } - public partial class LoadBalancerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected LoadBalancerCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string loadBalancerName, Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string loadBalancerName, Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + protected ConnectedClusterLoadBalancerCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string loadBalancerName, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string loadBalancerName, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class LoadBalancerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ConnectedClusterLoadBalancerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public LoadBalancerData() { } + public ConnectedClusterLoadBalancerData() { } public System.Collections.Generic.IList Addresses { get { throw null; } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode? AdvertiseMode { get { throw null; } set { } } public System.Collections.Generic.IList BgpPeers { get { throw null; } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } public System.Collections.Generic.IDictionary ServiceSelector { get { throw null; } } - Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData 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; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData 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 LoadBalancerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ConnectedClusterLoadBalancerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected LoadBalancerResource() { } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData Data { get { throw null; } } + protected ConnectedClusterLoadBalancerResource() { } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string loadBalancerName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class ServiceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected ServiceResource() { } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string serviceName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class ServiceResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected ServiceResourceCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string serviceName, Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string serviceName, Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ConnectedClusterServiceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectedClusterServiceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string serviceName, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string serviceName, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class ServiceResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ConnectedClusterServiceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ServiceResourceData() { } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? ProvisioningState { get { throw null; } } - public string RpObjectId { get { throw null; } } - Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData 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 ConnectedClusterServiceData() { } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } + public System.Guid? RpObjectId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData 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 StorageClassResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ConnectedClusterServiceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected StorageClassResource() { } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData Data { get { throw null; } } + protected ConnectedClusterServiceResource() { } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string storageClassName) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string serviceName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class StorageClassResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected StorageClassResourceCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string storageClassName, Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string storageClassName, Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ConnectedClusterStorageClassCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectedClusterStorageClassCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string storageClassName, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string storageClassName, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class StorageClassResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ConnectedClusterStorageClassData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public StorageClassResourceData() { } - public System.Collections.Generic.IList AccessModes { get { throw null; } } + public ConnectedClusterStorageClassData() { } + public System.Collections.Generic.IList AccessModes { get { throw null; } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? AllowVolumeExpansion { get { throw null; } set { } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? DataResilience { get { throw null; } set { } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? FailoverSpeed { get { throw null; } set { } } @@ -213,14 +178,53 @@ public StorageClassResourceData() { } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? Performance { get { throw null; } set { } } public long? Priority { get { throw null; } set { } } public string Provisioner { get { throw null; } set { } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties TypeProperties { get { throw null; } set { } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode? VolumeBindingMode { get { throw null; } set { } } - Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData 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; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData 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 ConnectedClusterStorageClassResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ConnectedClusterStorageClassResource() { } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string storageClassName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterStorageClassPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterStorageClassPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class ContainerOrchestratorRuntimeExtensions + { + public static Azure.Response GetBgpPeer(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetBgpPeerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerResource GetBgpPeerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerCollection GetBgpPeers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.Response GetConnectedClusterLoadBalancer(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConnectedClusterLoadBalancerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerResource GetConnectedClusterLoadBalancerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerCollection GetConnectedClusterLoadBalancers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.Response GetConnectedClusterService(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConnectedClusterServiceAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceResource GetConnectedClusterServiceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceCollection GetConnectedClusterServices(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.Response GetConnectedClusterStorageClass(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConnectedClusterStorageClassAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassCollection GetConnectedClusterStorageClasses(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassResource GetConnectedClusterStorageClassResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } } namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Mocking @@ -232,48 +236,30 @@ protected MockableContainerOrchestratorRuntimeArmClient() { } public virtual System.Threading.Tasks.Task> GetBgpPeerAsync(Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerResource GetBgpPeerResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerCollection GetBgpPeers(Azure.Core.ResourceIdentifier scope) { throw null; } - public virtual Azure.Response GetLoadBalancer(Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetLoadBalancerAsync(Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerResource GetLoadBalancerResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerCollection GetLoadBalancers(Azure.Core.ResourceIdentifier scope) { throw null; } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResource GetServiceResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.Response GetServiceResource(Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetServiceResourceAsync(Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceCollection GetServiceResources(Azure.Core.ResourceIdentifier scope) { throw null; } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResource GetStorageClassResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.Response GetStorageClassResource(Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetStorageClassResourceAsync(Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceCollection GetStorageClassResources(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.Response GetConnectedClusterLoadBalancer(Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedClusterLoadBalancerAsync(Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerResource GetConnectedClusterLoadBalancerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerCollection GetConnectedClusterLoadBalancers(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.Response GetConnectedClusterService(Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedClusterServiceAsync(Azure.Core.ResourceIdentifier scope, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceResource GetConnectedClusterServiceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceCollection GetConnectedClusterServices(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.Response GetConnectedClusterStorageClass(Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedClusterStorageClassAsync(Azure.Core.ResourceIdentifier scope, string storageClassName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassCollection GetConnectedClusterStorageClasses(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassResource GetConnectedClusterStorageClassResource(Azure.Core.ResourceIdentifier id) { throw null; } } } namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models { - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct AccessMode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public AccessMode(string value) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode ReadWriteMany { get { throw null; } } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode ReadWriteOnce { get { throw null; } } - public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode right) { throw null; } - public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AccessMode right) { throw null; } - public override string ToString() { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct AdvertiseMode : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public AdvertiseMode(string value) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode ARP { get { throw null; } } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode BGP { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode Arp { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode Bgp { get { throw null; } } public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode Both { get { throw null; } } public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -287,22 +273,57 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models } public static partial class ArmContainerOrchestratorRuntimeModelFactory { - public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData BgpPeerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? myAsn = default(int?), int? peerAsn = default(int?), string peerAddress = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.LoadBalancerData LoadBalancerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable addresses = null, System.Collections.Generic.IDictionary serviceSelector = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode? advertiseMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode?), System.Collections.Generic.IEnumerable bgpPeers = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.ServiceResourceData ServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string rpObjectId = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.StorageClassResourceData StorageClassResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? allowVolumeExpansion = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion?), System.Collections.Generic.IEnumerable mountOptions = null, string provisioner = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode? volumeBindingMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode?), System.Collections.Generic.IEnumerable accessModes = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? dataResilience = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? failoverSpeed = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier?), System.Collections.Generic.IEnumerable limitations = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? performance = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier?), long? priority = default(long?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties typeProperties = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData BgpPeerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? myAsn = default(int?), int? peerAsn = default(int?), string peerAddress = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData ConnectedClusterLoadBalancerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable addresses = null, System.Collections.Generic.IDictionary serviceSelector = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode? advertiseMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode?), System.Collections.Generic.IEnumerable bgpPeers = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData ConnectedClusterServiceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? rpObjectId = default(System.Guid?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData ConnectedClusterStorageClassData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? allowVolumeExpansion = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion?), System.Collections.Generic.IEnumerable mountOptions = null, string provisioner = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode? volumeBindingMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode?), System.Collections.Generic.IEnumerable accessModes = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? dataResilience = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? failoverSpeed = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier?), System.Collections.Generic.IEnumerable limitations = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? performance = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier?), long? priority = default(long?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties typeProperties = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } } public partial class BlobStorageClassTypeProperties : Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BlobStorageClassTypeProperties(string azureStorageAccountName, string azureStorageAccountKey) { } public string AzureStorageAccountKey { get { throw null; } set { } } public string AzureStorageAccountName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.BlobStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.BlobStorageClassTypeProperties 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 ConnectedClusterStorageClassPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedClusterStorageClassPatch() { } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassPropertiesUpdate Properties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterStorageClassPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterStorageClassPatch 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 ContainerOrchestratorProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerOrchestratorProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct DataResilienceTier : System.IEquatable { @@ -344,6 +365,7 @@ public BlobStorageClassTypeProperties(string azureStorageAccountName, string azu public partial class NativeStorageClassTypeProperties : Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NativeStorageClassTypeProperties() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NativeStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NativeStorageClassTypeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -376,6 +398,7 @@ public NfsStorageClassTypeProperties(string server, string share) { } public string Server { get { throw null; } set { } } public string Share { get { throw null; } set { } } public string SubDir { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.NfsStorageClassTypeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -403,33 +426,11 @@ public NfsStorageClassTypeProperties(string server, string share) { } public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ProvisioningState : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ProvisioningState(string value) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Accepted { get { throw null; } } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Canceled { get { throw null; } } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Deleting { get { throw null; } } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Failed { get { throw null; } } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Provisioning { get { throw null; } } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Succeeded { get { throw null; } } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState Updating { get { throw null; } } - public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState right) { throw null; } - public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ProvisioningState right) { throw null; } - public override string ToString() { throw null; } - } public partial class RwxStorageClassTypeProperties : Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RwxStorageClassTypeProperties(string backingStorageClassName) { } public string BackingStorageClassName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.RwxStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.RwxStorageClassTypeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -444,16 +445,35 @@ public SmbStorageClassTypeProperties(string source) { } public string Source { get { throw null; } set { } } public string SubDir { get { throw null; } set { } } public string Username { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.SmbStorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.SmbStorageClassTypeProperties 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 StorageClassAccessMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageClassAccessMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassAccessMode ReadWriteMany { get { throw null; } } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassAccessMode ReadWriteOnce { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassAccessMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassAccessMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassAccessMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassAccessMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassAccessMode left, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassAccessMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageClassPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public StorageClassPropertiesUpdate() { } - public System.Collections.Generic.IList AccessModes { get { throw null; } } + public System.Collections.Generic.IList AccessModes { get { throw null; } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? AllowVolumeExpansion { get { throw null; } set { } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? DataResilience { get { throw null; } set { } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? FailoverSpeed { get { throw null; } set { } } @@ -462,25 +482,17 @@ public StorageClassPropertiesUpdate() { } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? Performance { get { throw null; } set { } } public long? Priority { get { throw null; } set { } } public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypePropertiesUpdate TypeProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassPropertiesUpdate 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 StorageClassResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public StorageClassResourcePatch() { } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassPropertiesUpdate Properties { get { throw null; } set { } } - Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassResourcePatch 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 abstract partial class StorageClassTypeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected StorageClassTypeProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -502,6 +514,7 @@ public StorageClassTypePropertiesUpdate() { } public string Source { get { throw null; } set { } } public string SubDir { get { throw null; } set { } } public string Username { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypePropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypePropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerCollection.cs similarity index 82% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerCollection.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerCollection.cs index 1c271bc10d6b8..8b06969abdf21 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerCollection.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { - public partial class Sample_BgpPeerCollection + public partial class Sample_ConnectedClusterBgpPeerCollection { // BgpPeers_List [NUnit.Framework.Test] @@ -30,17 +30,17 @@ public async Task GetAll_BgpPeersList() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this BgpPeerResource + // get the collection of this ConnectedClusterBgpPeerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - BgpPeerCollection collection = client.GetBgpPeers(scopeId); + ConnectedClusterBgpPeerCollection collection = client.GetConnectedClusterBgpPeers(scopeId); // invoke the operation and iterate over the result - await foreach (BgpPeerResource item in collection.GetAllAsync()) + await foreach (ConnectedClusterBgpPeerResource 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 - BgpPeerData resourceData = item.Data; + ConnectedClusterBgpPeerData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -64,18 +64,18 @@ public async Task Get_BgpPeersGet() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this BgpPeerResource + // get the collection of this ConnectedClusterBgpPeerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - BgpPeerCollection collection = client.GetBgpPeers(scopeId); + ConnectedClusterBgpPeerCollection collection = client.GetConnectedClusterBgpPeers(scopeId); // invoke the operation string bgpPeerName = "testpeer"; - BgpPeerResource result = await collection.GetAsync(bgpPeerName); + ConnectedClusterBgpPeerResource result = await collection.GetAsync(bgpPeerName); // 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 - BgpPeerData resourceData = result.Data; + ConnectedClusterBgpPeerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -96,10 +96,10 @@ public async Task Exists_BgpPeersGet() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this BgpPeerResource + // get the collection of this ConnectedClusterBgpPeerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - BgpPeerCollection collection = client.GetBgpPeers(scopeId); + ConnectedClusterBgpPeerCollection collection = client.GetConnectedClusterBgpPeers(scopeId); // invoke the operation string bgpPeerName = "testpeer"; @@ -124,15 +124,15 @@ public async Task GetIfExists_BgpPeersGet() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this BgpPeerResource + // get the collection of this ConnectedClusterBgpPeerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - BgpPeerCollection collection = client.GetBgpPeers(scopeId); + ConnectedClusterBgpPeerCollection collection = client.GetConnectedClusterBgpPeers(scopeId); // invoke the operation string bgpPeerName = "testpeer"; - NullableResponse response = await collection.GetIfExistsAsync(bgpPeerName); - BgpPeerResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(bgpPeerName); + ConnectedClusterBgpPeerResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -142,7 +142,7 @@ public async Task GetIfExists_BgpPeersGet() { // 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 - BgpPeerData resourceData = result.Data; + ConnectedClusterBgpPeerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -164,25 +164,25 @@ public async Task CreateOrUpdate_BgpPeersCreateOrUpdate() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this BgpPeerResource + // get the collection of this ConnectedClusterBgpPeerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - BgpPeerCollection collection = client.GetBgpPeers(scopeId); + ConnectedClusterBgpPeerCollection collection = client.GetConnectedClusterBgpPeers(scopeId); // invoke the operation string bgpPeerName = "testpeer"; - BgpPeerData data = new BgpPeerData() + ConnectedClusterBgpPeerData data = new ConnectedClusterBgpPeerData() { MyAsn = 64500, PeerAsn = 64501, PeerAddress = "10.0.0.1", }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, bgpPeerName, data); - BgpPeerResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, bgpPeerName, data); + ConnectedClusterBgpPeerResource 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 - BgpPeerData resourceData = result.Data; + ConnectedClusterBgpPeerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerResource.cs similarity index 66% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerResource.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerResource.cs index a05d6b7dc69bc..fc8406078e658 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_BgpPeerResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerResource.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { - public partial class Sample_BgpPeerResource + public partial class Sample_ConnectedClusterBgpPeerResource { // BgpPeers_Get [NUnit.Framework.Test] @@ -27,19 +27,19 @@ public async Task Get_BgpPeersGet() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BgpPeerResource created on azure - // for more information of creating BgpPeerResource, please refer to the document of BgpPeerResource + // this example assumes you already have this ConnectedClusterBgpPeerResource created on azure + // for more information of creating ConnectedClusterBgpPeerResource, please refer to the document of ConnectedClusterBgpPeerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string bgpPeerName = "testpeer"; - ResourceIdentifier bgpPeerResourceId = BgpPeerResource.CreateResourceIdentifier(resourceUri, bgpPeerName); - BgpPeerResource bgpPeer = client.GetBgpPeerResource(bgpPeerResourceId); + ResourceIdentifier connectedClusterBgpPeerResourceId = ConnectedClusterBgpPeerResource.CreateResourceIdentifier(resourceUri, bgpPeerName); + ConnectedClusterBgpPeerResource connectedClusterBgpPeer = client.GetConnectedClusterBgpPeerResource(connectedClusterBgpPeerResourceId); // invoke the operation - BgpPeerResource result = await bgpPeer.GetAsync(); + ConnectedClusterBgpPeerResource result = await connectedClusterBgpPeer.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 - BgpPeerData resourceData = result.Data; + ConnectedClusterBgpPeerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -57,26 +57,26 @@ public async Task Update_BgpPeersCreateOrUpdate() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BgpPeerResource created on azure - // for more information of creating BgpPeerResource, please refer to the document of BgpPeerResource + // this example assumes you already have this ConnectedClusterBgpPeerResource created on azure + // for more information of creating ConnectedClusterBgpPeerResource, please refer to the document of ConnectedClusterBgpPeerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string bgpPeerName = "testpeer"; - ResourceIdentifier bgpPeerResourceId = BgpPeerResource.CreateResourceIdentifier(resourceUri, bgpPeerName); - BgpPeerResource bgpPeer = client.GetBgpPeerResource(bgpPeerResourceId); + ResourceIdentifier connectedClusterBgpPeerResourceId = ConnectedClusterBgpPeerResource.CreateResourceIdentifier(resourceUri, bgpPeerName); + ConnectedClusterBgpPeerResource connectedClusterBgpPeer = client.GetConnectedClusterBgpPeerResource(connectedClusterBgpPeerResourceId); // invoke the operation - BgpPeerData data = new BgpPeerData() + ConnectedClusterBgpPeerData data = new ConnectedClusterBgpPeerData() { MyAsn = 64500, PeerAsn = 64501, PeerAddress = "10.0.0.1", }; - ArmOperation lro = await bgpPeer.UpdateAsync(WaitUntil.Completed, data); - BgpPeerResource result = lro.Value; + ArmOperation lro = await connectedClusterBgpPeer.UpdateAsync(WaitUntil.Completed, data); + ConnectedClusterBgpPeerResource 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 - BgpPeerData resourceData = result.Data; + ConnectedClusterBgpPeerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -94,15 +94,15 @@ public async Task Delete_BgpPeersDelete() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BgpPeerResource created on azure - // for more information of creating BgpPeerResource, please refer to the document of BgpPeerResource + // this example assumes you already have this ConnectedClusterBgpPeerResource created on azure + // for more information of creating ConnectedClusterBgpPeerResource, please refer to the document of ConnectedClusterBgpPeerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string bgpPeerName = "testpeer"; - ResourceIdentifier bgpPeerResourceId = BgpPeerResource.CreateResourceIdentifier(resourceUri, bgpPeerName); - BgpPeerResource bgpPeer = client.GetBgpPeerResource(bgpPeerResourceId); + ResourceIdentifier connectedClusterBgpPeerResourceId = ConnectedClusterBgpPeerResource.CreateResourceIdentifier(resourceUri, bgpPeerName); + ConnectedClusterBgpPeerResource connectedClusterBgpPeer = client.GetConnectedClusterBgpPeerResource(connectedClusterBgpPeerResourceId); // invoke the operation - await bgpPeer.DeleteAsync(WaitUntil.Completed); + await connectedClusterBgpPeer.DeleteAsync(WaitUntil.Completed); Console.WriteLine($"Succeeded"); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerCollection.cs similarity index 81% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerCollection.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerCollection.cs index 55c63ff242157..5aef4e1fa4acf 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerCollection.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { - public partial class Sample_LoadBalancerCollection + public partial class Sample_ConnectedClusterLoadBalancerCollection { // LoadBalancers_List [NUnit.Framework.Test] @@ -31,17 +31,17 @@ public async Task GetAll_LoadBalancersList() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this LoadBalancerResource + // get the collection of this ConnectedClusterLoadBalancerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + ConnectedClusterLoadBalancerCollection collection = client.GetConnectedClusterLoadBalancers(scopeId); // invoke the operation and iterate over the result - await foreach (LoadBalancerResource item in collection.GetAllAsync()) + await foreach (ConnectedClusterLoadBalancerResource 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 - LoadBalancerData resourceData = item.Data; + ConnectedClusterLoadBalancerData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -65,18 +65,18 @@ public async Task Get_LoadBalancersGet() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this LoadBalancerResource + // get the collection of this ConnectedClusterLoadBalancerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + ConnectedClusterLoadBalancerCollection collection = client.GetConnectedClusterLoadBalancers(scopeId); // invoke the operation string loadBalancerName = "testlb"; - LoadBalancerResource result = await collection.GetAsync(loadBalancerName); + ConnectedClusterLoadBalancerResource result = await collection.GetAsync(loadBalancerName); // 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 - LoadBalancerData resourceData = result.Data; + ConnectedClusterLoadBalancerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -97,10 +97,10 @@ public async Task Exists_LoadBalancersGet() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this LoadBalancerResource + // get the collection of this ConnectedClusterLoadBalancerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + ConnectedClusterLoadBalancerCollection collection = client.GetConnectedClusterLoadBalancers(scopeId); // invoke the operation string loadBalancerName = "testlb"; @@ -125,15 +125,15 @@ public async Task GetIfExists_LoadBalancersGet() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this LoadBalancerResource + // get the collection of this ConnectedClusterLoadBalancerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + ConnectedClusterLoadBalancerCollection collection = client.GetConnectedClusterLoadBalancers(scopeId); // invoke the operation string loadBalancerName = "testlb"; - NullableResponse response = await collection.GetIfExistsAsync(loadBalancerName); - LoadBalancerResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(loadBalancerName); + ConnectedClusterLoadBalancerResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -143,7 +143,7 @@ public async Task GetIfExists_LoadBalancersGet() { // 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 - LoadBalancerData resourceData = result.Data; + ConnectedClusterLoadBalancerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -165,14 +165,14 @@ public async Task CreateOrUpdate_LoadBalancersCreateOrUpdate() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this LoadBalancerResource + // get the collection of this ConnectedClusterLoadBalancerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - LoadBalancerCollection collection = client.GetLoadBalancers(scopeId); + ConnectedClusterLoadBalancerCollection collection = client.GetConnectedClusterLoadBalancers(scopeId); // invoke the operation string loadBalancerName = "testlb"; - LoadBalancerData data = new LoadBalancerData() + ConnectedClusterLoadBalancerData data = new ConnectedClusterLoadBalancerData() { Addresses = { @@ -182,14 +182,14 @@ public async Task CreateOrUpdate_LoadBalancersCreateOrUpdate() { ["app"] = "frontend", }, - AdvertiseMode = AdvertiseMode.ARP, + AdvertiseMode = AdvertiseMode.Arp, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data); - LoadBalancerResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data); + ConnectedClusterLoadBalancerResource 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 - LoadBalancerData resourceData = result.Data; + ConnectedClusterLoadBalancerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerResource.cs similarity index 64% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerResource.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerResource.cs index 6967eefbd7267..8b79a14f100a3 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_LoadBalancerResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerResource.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { - public partial class Sample_LoadBalancerResource + public partial class Sample_ConnectedClusterLoadBalancerResource { // LoadBalancers_Get [NUnit.Framework.Test] @@ -28,19 +28,19 @@ public async Task Get_LoadBalancersGet() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this LoadBalancerResource created on azure - // for more information of creating LoadBalancerResource, please refer to the document of LoadBalancerResource + // this example assumes you already have this ConnectedClusterLoadBalancerResource created on azure + // for more information of creating ConnectedClusterLoadBalancerResource, please refer to the document of ConnectedClusterLoadBalancerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string loadBalancerName = "testlb"; - ResourceIdentifier loadBalancerResourceId = LoadBalancerResource.CreateResourceIdentifier(resourceUri, loadBalancerName); - LoadBalancerResource loadBalancer = client.GetLoadBalancerResource(loadBalancerResourceId); + ResourceIdentifier connectedClusterLoadBalancerResourceId = ConnectedClusterLoadBalancerResource.CreateResourceIdentifier(resourceUri, loadBalancerName); + ConnectedClusterLoadBalancerResource connectedClusterLoadBalancer = client.GetConnectedClusterLoadBalancerResource(connectedClusterLoadBalancerResourceId); // invoke the operation - LoadBalancerResource result = await loadBalancer.GetAsync(); + ConnectedClusterLoadBalancerResource result = await connectedClusterLoadBalancer.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 - LoadBalancerData resourceData = result.Data; + ConnectedClusterLoadBalancerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -58,15 +58,15 @@ public async Task Update_LoadBalancersCreateOrUpdate() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this LoadBalancerResource created on azure - // for more information of creating LoadBalancerResource, please refer to the document of LoadBalancerResource + // this example assumes you already have this ConnectedClusterLoadBalancerResource created on azure + // for more information of creating ConnectedClusterLoadBalancerResource, please refer to the document of ConnectedClusterLoadBalancerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string loadBalancerName = "testlb"; - ResourceIdentifier loadBalancerResourceId = LoadBalancerResource.CreateResourceIdentifier(resourceUri, loadBalancerName); - LoadBalancerResource loadBalancer = client.GetLoadBalancerResource(loadBalancerResourceId); + ResourceIdentifier connectedClusterLoadBalancerResourceId = ConnectedClusterLoadBalancerResource.CreateResourceIdentifier(resourceUri, loadBalancerName); + ConnectedClusterLoadBalancerResource connectedClusterLoadBalancer = client.GetConnectedClusterLoadBalancerResource(connectedClusterLoadBalancerResourceId); // invoke the operation - LoadBalancerData data = new LoadBalancerData() + ConnectedClusterLoadBalancerData data = new ConnectedClusterLoadBalancerData() { Addresses = { @@ -76,14 +76,14 @@ public async Task Update_LoadBalancersCreateOrUpdate() { ["app"] = "frontend", }, - AdvertiseMode = AdvertiseMode.ARP, + AdvertiseMode = AdvertiseMode.Arp, }; - ArmOperation lro = await loadBalancer.UpdateAsync(WaitUntil.Completed, data); - LoadBalancerResource result = lro.Value; + ArmOperation lro = await connectedClusterLoadBalancer.UpdateAsync(WaitUntil.Completed, data); + ConnectedClusterLoadBalancerResource 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 - LoadBalancerData resourceData = result.Data; + ConnectedClusterLoadBalancerData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -101,15 +101,15 @@ public async Task Delete_LoadBalancersDelete() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this LoadBalancerResource created on azure - // for more information of creating LoadBalancerResource, please refer to the document of LoadBalancerResource + // this example assumes you already have this ConnectedClusterLoadBalancerResource created on azure + // for more information of creating ConnectedClusterLoadBalancerResource, please refer to the document of ConnectedClusterLoadBalancerResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string loadBalancerName = "testlb"; - ResourceIdentifier loadBalancerResourceId = LoadBalancerResource.CreateResourceIdentifier(resourceUri, loadBalancerName); - LoadBalancerResource loadBalancer = client.GetLoadBalancerResource(loadBalancerResourceId); + ResourceIdentifier connectedClusterLoadBalancerResourceId = ConnectedClusterLoadBalancerResource.CreateResourceIdentifier(resourceUri, loadBalancerName); + ConnectedClusterLoadBalancerResource connectedClusterLoadBalancer = client.GetConnectedClusterLoadBalancerResource(connectedClusterLoadBalancerResourceId); // invoke the operation - await loadBalancer.DeleteAsync(WaitUntil.Completed); + await connectedClusterLoadBalancer.DeleteAsync(WaitUntil.Completed); Console.WriteLine($"Succeeded"); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResourceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceCollection.cs similarity index 82% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResourceCollection.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceCollection.cs index ccf9d7cd5a38b..0fc4f74ca0d32 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResourceCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceCollection.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { - public partial class Sample_ServiceResourceCollection + public partial class Sample_ConnectedClusterServiceCollection { // Services_List [NUnit.Framework.Test] @@ -30,17 +30,17 @@ public async Task GetAll_ServicesList() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this ServiceResource + // get the collection of this ConnectedClusterServiceResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - ServiceResourceCollection collection = client.GetServiceResources(scopeId); + ConnectedClusterServiceCollection collection = client.GetConnectedClusterServices(scopeId); // invoke the operation and iterate over the result - await foreach (ServiceResource item in collection.GetAllAsync()) + await foreach (ConnectedClusterServiceResource 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 - ServiceResourceData resourceData = item.Data; + ConnectedClusterServiceData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -64,18 +64,18 @@ public async Task Get_ServicesGet() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this ServiceResource + // get the collection of this ConnectedClusterServiceResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - ServiceResourceCollection collection = client.GetServiceResources(scopeId); + ConnectedClusterServiceCollection collection = client.GetConnectedClusterServices(scopeId); // invoke the operation string serviceName = "storageclass"; - ServiceResource result = await collection.GetAsync(serviceName); + ConnectedClusterServiceResource result = await collection.GetAsync(serviceName); // 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 - ServiceResourceData resourceData = result.Data; + ConnectedClusterServiceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -96,10 +96,10 @@ public async Task Exists_ServicesGet() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this ServiceResource + // get the collection of this ConnectedClusterServiceResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - ServiceResourceCollection collection = client.GetServiceResources(scopeId); + ConnectedClusterServiceCollection collection = client.GetConnectedClusterServices(scopeId); // invoke the operation string serviceName = "storageclass"; @@ -124,15 +124,15 @@ public async Task GetIfExists_ServicesGet() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this ServiceResource + // get the collection of this ConnectedClusterServiceResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - ServiceResourceCollection collection = client.GetServiceResources(scopeId); + ConnectedClusterServiceCollection collection = client.GetConnectedClusterServices(scopeId); // invoke the operation string serviceName = "storageclass"; - NullableResponse response = await collection.GetIfExistsAsync(serviceName); - ServiceResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(serviceName); + ConnectedClusterServiceResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -142,7 +142,7 @@ public async Task GetIfExists_ServicesGet() { // 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 - ServiceResourceData resourceData = result.Data; + ConnectedClusterServiceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -164,20 +164,20 @@ public async Task CreateOrUpdate_ServicesCreateOrUpdate() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this ServiceResource + // get the collection of this ConnectedClusterServiceResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - ServiceResourceCollection collection = client.GetServiceResources(scopeId); + ConnectedClusterServiceCollection collection = client.GetConnectedClusterServices(scopeId); // invoke the operation string serviceName = "storageclass"; - ServiceResourceData data = new ServiceResourceData(); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data); - ServiceResource result = lro.Value; + ConnectedClusterServiceData data = new ConnectedClusterServiceData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data); + ConnectedClusterServiceResource 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 - ServiceResourceData resourceData = result.Data; + ConnectedClusterServiceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceResource.cs similarity index 65% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResource.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceResource.cs index 8672ad2dda2c5..3ea04e049e616 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ServiceResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceResource.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { - public partial class Sample_ServiceResource + public partial class Sample_ConnectedClusterServiceResource { // Services_Get [NUnit.Framework.Test] @@ -27,19 +27,19 @@ public async Task Get_ServicesGet() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this ServiceResource created on azure - // for more information of creating ServiceResource, please refer to the document of ServiceResource + // this example assumes you already have this ConnectedClusterServiceResource created on azure + // for more information of creating ConnectedClusterServiceResource, please refer to the document of ConnectedClusterServiceResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string serviceName = "storageclass"; - ResourceIdentifier serviceResourceId = ServiceResource.CreateResourceIdentifier(resourceUri, serviceName); - ServiceResource serviceResource = client.GetServiceResource(serviceResourceId); + ResourceIdentifier connectedClusterServiceResourceId = ConnectedClusterServiceResource.CreateResourceIdentifier(resourceUri, serviceName); + ConnectedClusterServiceResource connectedClusterService = client.GetConnectedClusterServiceResource(connectedClusterServiceResourceId); // invoke the operation - ServiceResource result = await serviceResource.GetAsync(); + ConnectedClusterServiceResource result = await connectedClusterService.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 - ServiceResourceData resourceData = result.Data; + ConnectedClusterServiceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -57,21 +57,21 @@ public async Task Update_ServicesCreateOrUpdate() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this ServiceResource created on azure - // for more information of creating ServiceResource, please refer to the document of ServiceResource + // this example assumes you already have this ConnectedClusterServiceResource created on azure + // for more information of creating ConnectedClusterServiceResource, please refer to the document of ConnectedClusterServiceResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string serviceName = "storageclass"; - ResourceIdentifier serviceResourceId = ServiceResource.CreateResourceIdentifier(resourceUri, serviceName); - ServiceResource serviceResource = client.GetServiceResource(serviceResourceId); + ResourceIdentifier connectedClusterServiceResourceId = ConnectedClusterServiceResource.CreateResourceIdentifier(resourceUri, serviceName); + ConnectedClusterServiceResource connectedClusterService = client.GetConnectedClusterServiceResource(connectedClusterServiceResourceId); // invoke the operation - ServiceResourceData data = new ServiceResourceData(); - ArmOperation lro = await serviceResource.UpdateAsync(WaitUntil.Completed, data); - ServiceResource result = lro.Value; + ConnectedClusterServiceData data = new ConnectedClusterServiceData(); + ArmOperation lro = await connectedClusterService.UpdateAsync(WaitUntil.Completed, data); + ConnectedClusterServiceResource 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 - ServiceResourceData resourceData = result.Data; + ConnectedClusterServiceData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -89,15 +89,15 @@ public async Task Delete_ServicesDelete() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this ServiceResource created on azure - // for more information of creating ServiceResource, please refer to the document of ServiceResource + // this example assumes you already have this ConnectedClusterServiceResource created on azure + // for more information of creating ConnectedClusterServiceResource, please refer to the document of ConnectedClusterServiceResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string serviceName = "storageclass"; - ResourceIdentifier serviceResourceId = ServiceResource.CreateResourceIdentifier(resourceUri, serviceName); - ServiceResource serviceResource = client.GetServiceResource(serviceResourceId); + ResourceIdentifier connectedClusterServiceResourceId = ConnectedClusterServiceResource.CreateResourceIdentifier(resourceUri, serviceName); + ConnectedClusterServiceResource connectedClusterService = client.GetConnectedClusterServiceResource(connectedClusterServiceResourceId); // invoke the operation - await serviceResource.DeleteAsync(WaitUntil.Completed); + await connectedClusterService.DeleteAsync(WaitUntil.Completed); Console.WriteLine($"Succeeded"); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResourceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassCollection.cs similarity index 81% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResourceCollection.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassCollection.cs index e0fc7961680e6..6b15cbf55e22b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResourceCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassCollection.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { - public partial class Sample_StorageClassResourceCollection + public partial class Sample_ConnectedClusterStorageClassCollection { // StorageClass_List_0 [NUnit.Framework.Test] @@ -31,17 +31,17 @@ public async Task GetAll_StorageClassList0() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this StorageClassResource + // get the collection of this ConnectedClusterStorageClassResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + ConnectedClusterStorageClassCollection collection = client.GetConnectedClusterStorageClasses(scopeId); // invoke the operation and iterate over the result - await foreach (StorageClassResource item in collection.GetAllAsync()) + await foreach (ConnectedClusterStorageClassResource 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 - StorageClassResourceData resourceData = item.Data; + ConnectedClusterStorageClassData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -65,18 +65,18 @@ public async Task Get_StorageClassGet0() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this StorageClassResource + // get the collection of this ConnectedClusterStorageClassResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + ConnectedClusterStorageClassCollection collection = client.GetConnectedClusterStorageClasses(scopeId); // invoke the operation string storageClassName = "testrwx"; - StorageClassResource result = await collection.GetAsync(storageClassName); + ConnectedClusterStorageClassResource result = await collection.GetAsync(storageClassName); // 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 - StorageClassResourceData resourceData = result.Data; + ConnectedClusterStorageClassData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -97,10 +97,10 @@ public async Task Exists_StorageClassGet0() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this StorageClassResource + // get the collection of this ConnectedClusterStorageClassResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + ConnectedClusterStorageClassCollection collection = client.GetConnectedClusterStorageClasses(scopeId); // invoke the operation string storageClassName = "testrwx"; @@ -125,15 +125,15 @@ public async Task GetIfExists_StorageClassGet0() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this StorageClassResource + // get the collection of this ConnectedClusterStorageClassResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + ConnectedClusterStorageClassCollection collection = client.GetConnectedClusterStorageClasses(scopeId); // invoke the operation string storageClassName = "testrwx"; - NullableResponse response = await collection.GetIfExistsAsync(storageClassName); - StorageClassResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(storageClassName); + ConnectedClusterStorageClassResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -143,7 +143,7 @@ public async Task GetIfExists_StorageClassGet0() { // 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 - StorageClassResourceData resourceData = result.Data; + ConnectedClusterStorageClassData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -165,23 +165,23 @@ public async Task CreateOrUpdate_StorageClassCreateOrUpdate0() // this example assumes you already have this ArmResource created on azure // for more information of creating ArmResource, please refer to the document of ArmResource - // get the collection of this StorageClassResource + // get the collection of this ConnectedClusterStorageClassResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - StorageClassResourceCollection collection = client.GetStorageClassResources(scopeId); + ConnectedClusterStorageClassCollection collection = client.GetConnectedClusterStorageClasses(scopeId); // invoke the operation string storageClassName = "testrwx"; - StorageClassResourceData data = new StorageClassResourceData() + ConnectedClusterStorageClassData data = new ConnectedClusterStorageClassData() { TypeProperties = new RwxStorageClassTypeProperties("default"), }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, storageClassName, data); - StorageClassResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, storageClassName, data); + ConnectedClusterStorageClassResource 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 - StorageClassResourceData resourceData = result.Data; + ConnectedClusterStorageClassData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassResource.cs similarity index 65% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResource.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassResource.cs index 7e638590ea1a6..1d2db495f3d58 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_StorageClassResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassResource.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { - public partial class Sample_StorageClassResource + public partial class Sample_ConnectedClusterStorageClassResource { // StorageClass_Get_0 [NUnit.Framework.Test] @@ -28,19 +28,19 @@ public async Task Get_StorageClassGet0() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this StorageClassResource created on azure - // for more information of creating StorageClassResource, please refer to the document of StorageClassResource + // this example assumes you already have this ConnectedClusterStorageClassResource created on azure + // for more information of creating ConnectedClusterStorageClassResource, please refer to the document of ConnectedClusterStorageClassResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string storageClassName = "testrwx"; - ResourceIdentifier storageClassResourceId = StorageClassResource.CreateResourceIdentifier(resourceUri, storageClassName); - StorageClassResource storageClassResource = client.GetStorageClassResource(storageClassResourceId); + ResourceIdentifier connectedClusterStorageClassResourceId = ConnectedClusterStorageClassResource.CreateResourceIdentifier(resourceUri, storageClassName); + ConnectedClusterStorageClassResource connectedClusterStorageClass = client.GetConnectedClusterStorageClassResource(connectedClusterStorageClassResourceId); // invoke the operation - StorageClassResource result = await storageClassResource.GetAsync(); + ConnectedClusterStorageClassResource result = await connectedClusterStorageClass.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 - StorageClassResourceData resourceData = result.Data; + ConnectedClusterStorageClassData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -58,15 +58,15 @@ public async Task Update_StorageClassUpdate0() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this StorageClassResource created on azure - // for more information of creating StorageClassResource, please refer to the document of StorageClassResource + // this example assumes you already have this ConnectedClusterStorageClassResource created on azure + // for more information of creating ConnectedClusterStorageClassResource, please refer to the document of ConnectedClusterStorageClassResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string storageClassName = "testrwx"; - ResourceIdentifier storageClassResourceId = StorageClassResource.CreateResourceIdentifier(resourceUri, storageClassName); - StorageClassResource storageClassResource = client.GetStorageClassResource(storageClassResourceId); + ResourceIdentifier connectedClusterStorageClassResourceId = ConnectedClusterStorageClassResource.CreateResourceIdentifier(resourceUri, storageClassName); + ConnectedClusterStorageClassResource connectedClusterStorageClass = client.GetConnectedClusterStorageClassResource(connectedClusterStorageClassResourceId); // invoke the operation - StorageClassResourcePatch patch = new StorageClassResourcePatch() + ConnectedClusterStorageClassPatch patch = new ConnectedClusterStorageClassPatch() { Properties = new StorageClassPropertiesUpdate() { @@ -76,12 +76,12 @@ public async Task Update_StorageClassUpdate0() }, }, }; - ArmOperation lro = await storageClassResource.UpdateAsync(WaitUntil.Completed, patch); - StorageClassResource result = lro.Value; + ArmOperation lro = await connectedClusterStorageClass.UpdateAsync(WaitUntil.Completed, patch); + ConnectedClusterStorageClassResource 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 - StorageClassResourceData resourceData = result.Data; + ConnectedClusterStorageClassData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -99,15 +99,15 @@ public async Task Delete_StorageClassDelete0() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this StorageClassResource created on azure - // for more information of creating StorageClassResource, please refer to the document of StorageClassResource + // this example assumes you already have this ConnectedClusterStorageClassResource created on azure + // for more information of creating ConnectedClusterStorageClassResource, please refer to the document of ConnectedClusterStorageClassResource string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; string storageClassName = "testrwx"; - ResourceIdentifier storageClassResourceId = StorageClassResource.CreateResourceIdentifier(resourceUri, storageClassName); - StorageClassResource storageClassResource = client.GetStorageClassResource(storageClassResourceId); + ResourceIdentifier connectedClusterStorageClassResourceId = ConnectedClusterStorageClassResource.CreateResourceIdentifier(resourceUri, storageClassName); + ConnectedClusterStorageClassResource connectedClusterStorageClass = client.GetConnectedClusterStorageClassResource(connectedClusterStorageClassResourceId); // invoke the operation - await storageClassResource.DeleteAsync(WaitUntil.Completed); + await connectedClusterStorageClass.DeleteAsync(WaitUntil.Completed); Console.WriteLine($"Succeeded"); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs index b1801291e94f8..cbe24362ba789 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs @@ -16,7 +16,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models /// Model factory for models. public static partial class ArmContainerOrchestratorRuntimeModelFactory { - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -25,10 +25,10 @@ public static partial class ArmContainerOrchestratorRuntimeModelFactory /// Peer ASN. /// Peer Address. /// Resource provision state. - /// A new instance for mocking. - public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? myAsn = null, int? peerAsn = null, string peerAddress = null, ContainerOrchestratorProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static ConnectedClusterBgpPeerData ConnectedClusterBgpPeerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? myAsn = null, int? peerAsn = null, string peerAddress = null, ContainerOrchestratorProvisioningState? provisioningState = null) { - return new BgpPeerData( + return new ConnectedClusterBgpPeerData( id, name, resourceType, @@ -40,7 +40,7 @@ public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -50,14 +50,14 @@ public static BgpPeerData BgpPeerData(ResourceIdentifier id = null, string name /// Advertise Mode. /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. /// Resource provision state. - /// A new instance for mocking. - public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable addresses = null, IDictionary serviceSelector = null, AdvertiseMode? advertiseMode = null, IEnumerable bgpPeers = null, ContainerOrchestratorProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static ConnectedClusterLoadBalancerData ConnectedClusterLoadBalancerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable addresses = null, IDictionary serviceSelector = null, AdvertiseMode? advertiseMode = null, IEnumerable bgpPeers = null, ContainerOrchestratorProvisioningState? provisioningState = null) { addresses ??= new List(); serviceSelector ??= new Dictionary(); bgpPeers ??= new List(); - return new LoadBalancerData( + return new ConnectedClusterLoadBalancerData( id, name, resourceType, @@ -70,17 +70,17 @@ public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, st serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The object id of the service principal of the RP provisioned in the tenant. /// Resource provision state. - /// A new instance for mocking. - public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? rpObjectId = null, ContainerOrchestratorProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static ConnectedClusterServiceData ConnectedClusterServiceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? rpObjectId = null, ContainerOrchestratorProvisioningState? provisioningState = null) { - return new ServiceResourceData( + return new ConnectedClusterServiceData( id, name, resourceType, @@ -90,7 +90,7 @@ public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = nu serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -111,14 +111,14 @@ public static ServiceResourceData ServiceResourceData(ResourceIdentifier id = nu /// The available derived classes include , , , and . /// /// Resource provision state. - /// A new instance for mocking. - public static StorageClassResourceData StorageClassResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeExpansion? allowVolumeExpansion = null, IEnumerable mountOptions = null, string provisioner = null, VolumeBindingMode? volumeBindingMode = null, IEnumerable accessModes = null, DataResilienceTier? dataResilience = null, FailoverTier? failoverSpeed = null, IEnumerable limitations = null, PerformanceTier? performance = null, long? priority = null, StorageClassTypeProperties typeProperties = null, ContainerOrchestratorProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static ConnectedClusterStorageClassData ConnectedClusterStorageClassData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeExpansion? allowVolumeExpansion = null, IEnumerable mountOptions = null, string provisioner = null, VolumeBindingMode? volumeBindingMode = null, IEnumerable accessModes = null, DataResilienceTier? dataResilience = null, FailoverTier? failoverSpeed = null, IEnumerable limitations = null, PerformanceTier? performance = null, long? priority = null, StorageClassTypeProperties typeProperties = null, ContainerOrchestratorProvisioningState? provisioningState = null) { mountOptions ??= new List(); accessModes ??= new List(); limitations ??= new List(); - return new StorageClassResourceData( + return new ConnectedClusterStorageClassData( id, name, resourceType, diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.Serialization.cs deleted file mode 100644 index ed0d744d4b48f..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.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.ContainerOrchestratorRuntime -{ - public partial class BgpPeerResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - BgpPeerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - BgpPeerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerCollection.cs similarity index 65% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerCollection.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerCollection.cs index 1c5ef4ebb0903..d48fcfcc606a9 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerCollection.cs @@ -17,28 +17,28 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// 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 GetBgpPeers method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetConnectedClusterBgpPeers method from an instance of . /// - public partial class BgpPeerCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ConnectedClusterBgpPeerCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _bgpPeerClientDiagnostics; - private readonly BgpPeersRestOperations _bgpPeerRestClient; + private readonly ClientDiagnostics _connectedClusterBgpPeerBgpPeersClientDiagnostics; + private readonly BgpPeersRestOperations _connectedClusterBgpPeerBgpPeersRestClient; - /// Initializes a new instance of the class for mocking. - protected BgpPeerCollection() + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterBgpPeerCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal BgpPeerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedClusterBgpPeerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _bgpPeerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", BgpPeerResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(BgpPeerResource.ResourceType, out string bgpPeerApiVersion); - _bgpPeerRestClient = new BgpPeersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, bgpPeerApiVersion); + _connectedClusterBgpPeerBgpPeersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ConnectedClusterBgpPeerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ConnectedClusterBgpPeerResource.ResourceType, out string connectedClusterBgpPeerBgpPeersApiVersion); + _connectedClusterBgpPeerBgpPeersRestClient = new BgpPeersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterBgpPeerBgpPeersApiVersion); } /// @@ -58,7 +58,7 @@ internal BgpPeerCollection(ArmClient client, ResourceIdentifier id) : base(clien /// /// /// Resource - /// + /// /// /// /// @@ -68,17 +68,17 @@ internal BgpPeerCollection(ArmClient client, ResourceIdentifier id) : base(clien /// 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 bgpPeerName, BgpPeerData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string bgpPeerName, ConnectedClusterBgpPeerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.CreateOrUpdate"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _bgpPeerRestClient.CreateOrUpdateAsync(Id, bgpPeerName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerOrchestratorRuntimeArmOperation(new BgpPeerOperationSource(Client), _bgpPeerClientDiagnostics, Pipeline, _bgpPeerRestClient.CreateCreateOrUpdateRequest(Id, bgpPeerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _connectedClusterBgpPeerBgpPeersRestClient.CreateOrUpdateAsync(Id, bgpPeerName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterBgpPeerOperationSource(Client), _connectedClusterBgpPeerBgpPeersClientDiagnostics, Pipeline, _connectedClusterBgpPeerBgpPeersRestClient.CreateCreateOrUpdateRequest(Id, bgpPeerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -107,7 +107,7 @@ public virtual async Task> CreateOrUpdateAsync(Wai /// /// /// Resource - /// + /// /// /// /// @@ -117,17 +117,17 @@ public virtual async Task> CreateOrUpdateAsync(Wai /// 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 bgpPeerName, BgpPeerData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string bgpPeerName, ConnectedClusterBgpPeerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.CreateOrUpdate"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerCollection.CreateOrUpdate"); scope.Start(); try { - var response = _bgpPeerRestClient.CreateOrUpdate(Id, bgpPeerName, data, cancellationToken); - var operation = new ContainerOrchestratorRuntimeArmOperation(new BgpPeerOperationSource(Client), _bgpPeerClientDiagnostics, Pipeline, _bgpPeerRestClient.CreateCreateOrUpdateRequest(Id, bgpPeerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _connectedClusterBgpPeerBgpPeersRestClient.CreateOrUpdate(Id, bgpPeerName, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterBgpPeerOperationSource(Client), _connectedClusterBgpPeerBgpPeersClientDiagnostics, Pipeline, _connectedClusterBgpPeerBgpPeersRestClient.CreateCreateOrUpdateRequest(Id, bgpPeerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -156,7 +156,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, /// /// /// Resource - /// + /// /// /// /// @@ -164,18 +164,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string bgpPeerName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.Get"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerCollection.Get"); scope.Start(); try { - var response = await _bgpPeerRestClient.GetAsync(Id, bgpPeerName, cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterBgpPeerBgpPeersRestClient.GetAsync(Id, bgpPeerName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterBgpPeerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -201,7 +201,7 @@ public virtual async Task> GetAsync(string bgpPeerName /// /// /// Resource - /// + /// /// /// /// @@ -209,18 +209,18 @@ public virtual async Task> GetAsync(string bgpPeerName /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string bgpPeerName, CancellationToken cancellationToken = default) + public virtual Response Get(string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.Get"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerCollection.Get"); scope.Start(); try { - var response = _bgpPeerRestClient.Get(Id, bgpPeerName, cancellationToken); + var response = _connectedClusterBgpPeerBgpPeersRestClient.Get(Id, bgpPeerName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterBgpPeerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -246,17 +246,17 @@ public virtual Response Get(string bgpPeerName, CancellationTok /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _bgpPeerRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _bgpPeerRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BgpPeerResource(Client, BgpPeerData.DeserializeBgpPeerData(e)), _bgpPeerClientDiagnostics, Pipeline, "BgpPeerCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedClusterBgpPeerBgpPeersRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterBgpPeerBgpPeersRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterBgpPeerResource(Client, ConnectedClusterBgpPeerData.DeserializeConnectedClusterBgpPeerData(e)), _connectedClusterBgpPeerBgpPeersClientDiagnostics, Pipeline, "ConnectedClusterBgpPeerCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -276,17 +276,17 @@ public virtual AsyncPageable GetAllAsync(CancellationToken canc /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _bgpPeerRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _bgpPeerRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BgpPeerResource(Client, BgpPeerData.DeserializeBgpPeerData(e)), _bgpPeerClientDiagnostics, Pipeline, "BgpPeerCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedClusterBgpPeerBgpPeersRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterBgpPeerBgpPeersRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterBgpPeerResource(Client, ConnectedClusterBgpPeerData.DeserializeConnectedClusterBgpPeerData(e)), _connectedClusterBgpPeerBgpPeersClientDiagnostics, Pipeline, "ConnectedClusterBgpPeerCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -306,7 +306,7 @@ public virtual Pageable GetAll(CancellationToken cancellationTo /// /// /// Resource - /// + /// /// /// /// @@ -318,11 +318,11 @@ public virtual async Task> ExistsAsync(string bgpPeerName, Cancel { Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.Exists"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerCollection.Exists"); scope.Start(); try { - var response = await _bgpPeerRestClient.GetAsync(Id, bgpPeerName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterBgpPeerBgpPeersRestClient.GetAsync(Id, bgpPeerName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -349,7 +349,7 @@ public virtual async Task> ExistsAsync(string bgpPeerName, Cancel /// /// /// Resource - /// + /// /// /// /// @@ -361,11 +361,11 @@ public virtual Response Exists(string bgpPeerName, CancellationToken cance { Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.Exists"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerCollection.Exists"); scope.Start(); try { - var response = _bgpPeerRestClient.Get(Id, bgpPeerName, cancellationToken: cancellationToken); + var response = _connectedClusterBgpPeerBgpPeersRestClient.Get(Id, bgpPeerName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -392,7 +392,7 @@ public virtual Response Exists(string bgpPeerName, CancellationToken cance /// /// /// Resource - /// + /// /// /// /// @@ -400,18 +400,18 @@ public virtual Response Exists(string bgpPeerName, CancellationToken cance /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string bgpPeerName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.GetIfExists"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerCollection.GetIfExists"); scope.Start(); try { - var response = await _bgpPeerRestClient.GetAsync(Id, bgpPeerName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterBgpPeerBgpPeersRestClient.GetAsync(Id, bgpPeerName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterBgpPeerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -437,7 +437,7 @@ public virtual async Task> GetIfExistsAsync(st /// /// /// Resource - /// + /// /// /// /// @@ -445,18 +445,18 @@ public virtual async Task> GetIfExistsAsync(st /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string bgpPeerName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerCollection.GetIfExists"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerCollection.GetIfExists"); scope.Start(); try { - var response = _bgpPeerRestClient.Get(Id, bgpPeerName, cancellationToken: cancellationToken); + var response = _connectedClusterBgpPeerBgpPeersRestClient.Get(Id, bgpPeerName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterBgpPeerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -465,7 +465,7 @@ public virtual NullableResponse GetIfExists(string bgpPeerName, } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -475,7 +475,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.Serialization.cs similarity index 69% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.Serialization.cs index d97dcbbb2627e..a4ccfcce3d2ba 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.Serialization.cs @@ -15,39 +15,28 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { - public partial class BgpPeerData : IUtf8JsonSerializable, IJsonModel + public partial class ConnectedClusterBgpPeerData : 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; + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BgpPeerData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterBgpPeerData)} 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); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(MyAsn)) @@ -71,37 +60,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio writer.WriteStringValue(ProvisioningState.Value.ToString()); } 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(); } - BgpPeerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ConnectedClusterBgpPeerData 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(BgpPeerData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterBgpPeerData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBgpPeerData(document.RootElement, options); + return DeserializeConnectedClusterBgpPeerData(document.RootElement, options); } - internal static BgpPeerData DeserializeBgpPeerData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ConnectedClusterBgpPeerData DeserializeConnectedClusterBgpPeerData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -195,7 +168,7 @@ internal static BgpPeerData DeserializeBgpPeerData(JsonElement element, ModelRea } } serializedAdditionalRawData = rawDataDictionary; - return new BgpPeerData( + return new ConnectedClusterBgpPeerData( id, name, type, @@ -207,35 +180,35 @@ internal static BgpPeerData DeserializeBgpPeerData(JsonElement element, ModelRea 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(BgpPeerData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterBgpPeerData)} does not support writing '{options.Format}' format."); } } - BgpPeerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ConnectedClusterBgpPeerData 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 DeserializeBgpPeerData(document.RootElement, options); + return DeserializeConnectedClusterBgpPeerData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BgpPeerData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterBgpPeerData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.cs similarity index 81% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.cs index defc732a66b73..64b0f7997cdf9 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// A class representing the BgpPeer data model. + /// A class representing the ConnectedClusterBgpPeer data model. /// A BgpPeer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) /// - public partial class BgpPeerData : ResourceData + public partial class ConnectedClusterBgpPeerData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,12 +51,12 @@ public partial class BgpPeerData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public BgpPeerData() + /// Initializes a new instance of . + public ConnectedClusterBgpPeerData() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -66,7 +66,7 @@ public BgpPeerData() /// Peer Address. /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal BgpPeerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? myAsn, int? peerAsn, string peerAddress, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ConnectedClusterBgpPeerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? myAsn, int? peerAsn, string peerAddress, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { MyAsn = myAsn; PeerAsn = peerAsn; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerResource.Serialization.cs new file mode 100644 index 0000000000000..c9b1f1e68a344 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerResource.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.ContainerOrchestratorRuntime +{ + public partial class ConnectedClusterBgpPeerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectedClusterBgpPeerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ConnectedClusterBgpPeerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerResource.cs similarity index 69% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerResource.cs index ee0eb41dcfd44..39df17ebc2f4a 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/BgpPeerResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerResource.cs @@ -15,14 +15,14 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// A Class representing a BgpPeer 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 GetBgpPeerResource method. - /// Otherwise you can get one from its parent resource using the GetBgpPeer method. + /// A Class representing a ConnectedClusterBgpPeer 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 GetConnectedClusterBgpPeerResource method. + /// Otherwise you can get one from its parent resource using the GetConnectedClusterBgpPeer method. /// - public partial class BgpPeerResource : ArmResource + public partial class ConnectedClusterBgpPeerResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The resourceUri. /// The bgpPeerName. public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string bgpPeerName) @@ -31,35 +31,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, st return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _bgpPeerClientDiagnostics; - private readonly BgpPeersRestOperations _bgpPeerRestClient; - private readonly BgpPeerData _data; + private readonly ClientDiagnostics _connectedClusterBgpPeerBgpPeersClientDiagnostics; + private readonly BgpPeersRestOperations _connectedClusterBgpPeerBgpPeersRestClient; + private readonly ConnectedClusterBgpPeerData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.KubernetesRuntime/bgpPeers"; - /// Initializes a new instance of the class for mocking. - protected BgpPeerResource() + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterBgpPeerResource() { } - /// 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 BgpPeerResource(ArmClient client, BgpPeerData data) : this(client, data.Id) + internal ConnectedClusterBgpPeerResource(ArmClient client, ConnectedClusterBgpPeerData 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 BgpPeerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedClusterBgpPeerResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _bgpPeerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string bgpPeerApiVersion); - _bgpPeerRestClient = new BgpPeersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, bgpPeerApiVersion); + _connectedClusterBgpPeerBgpPeersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string connectedClusterBgpPeerBgpPeersApiVersion); + _connectedClusterBgpPeerBgpPeersRestClient = new BgpPeersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterBgpPeerBgpPeersApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -70,7 +70,7 @@ internal BgpPeerResource(ArmClient client, ResourceIdentifier id) : base(client, /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual BgpPeerData Data + public virtual ConnectedClusterBgpPeerData Data { get { @@ -103,21 +103,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// 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 = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Get"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerResource.Get"); scope.Start(); try { - var response = await _bgpPeerRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterBgpPeerBgpPeersRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterBgpPeerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -143,21 +143,21 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Get"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerResource.Get"); scope.Start(); try { - var response = _bgpPeerRestClient.Get(Id.Parent, Id.Name, cancellationToken); + var response = _connectedClusterBgpPeerBgpPeersRestClient.Get(Id.Parent, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BgpPeerResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterBgpPeerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationToken /// /// /// Resource - /// + /// /// /// /// @@ -191,12 +191,12 @@ public virtual Response Get(CancellationToken cancellationToken /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Delete"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerResource.Delete"); scope.Start(); try { - var response = await _bgpPeerRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _bgpPeerRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var response = await _connectedClusterBgpPeerBgpPeersRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _connectedClusterBgpPeerBgpPeersRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -235,12 +235,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 = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Delete"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerResource.Delete"); scope.Start(); try { - var response = _bgpPeerRestClient.Delete(Id.Parent, Id.Name, cancellationToken); - var uri = _bgpPeerRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var response = _connectedClusterBgpPeerBgpPeersRestClient.Delete(Id.Parent, Id.Name, cancellationToken); + var uri = _connectedClusterBgpPeerBgpPeersRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -279,16 +279,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// Resource create parameters. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, BgpPeerData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ConnectedClusterBgpPeerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Update"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerResource.Update"); scope.Start(); try { - var response = await _bgpPeerRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerOrchestratorRuntimeArmOperation(new BgpPeerOperationSource(Client), _bgpPeerClientDiagnostics, Pipeline, _bgpPeerRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _connectedClusterBgpPeerBgpPeersRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterBgpPeerOperationSource(Client), _connectedClusterBgpPeerBgpPeersClientDiagnostics, Pipeline, _connectedClusterBgpPeerBgpPeersRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -317,7 +317,7 @@ public virtual async Task> UpdateAsync(WaitUntil w /// /// /// Resource - /// + /// /// /// /// @@ -325,16 +325,16 @@ public virtual async Task> UpdateAsync(WaitUntil w /// Resource create parameters. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, BgpPeerData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ConnectedClusterBgpPeerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _bgpPeerClientDiagnostics.CreateScope("BgpPeerResource.Update"); + using var scope = _connectedClusterBgpPeerBgpPeersClientDiagnostics.CreateScope("ConnectedClusterBgpPeerResource.Update"); scope.Start(); try { - var response = _bgpPeerRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ContainerOrchestratorRuntimeArmOperation(new BgpPeerOperationSource(Client), _bgpPeerClientDiagnostics, Pipeline, _bgpPeerRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _connectedClusterBgpPeerBgpPeersRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterBgpPeerOperationSource(Client), _connectedClusterBgpPeerBgpPeersClientDiagnostics, Pipeline, _connectedClusterBgpPeerBgpPeersRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerCollection.cs similarity index 64% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerCollection.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerCollection.cs index d00361ce5e726..3616fb8fece25 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerCollection.cs @@ -17,28 +17,28 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// 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 GetLoadBalancers method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetConnectedClusterLoadBalancers method from an instance of . /// - public partial class LoadBalancerCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ConnectedClusterLoadBalancerCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _loadBalancerClientDiagnostics; - private readonly LoadBalancersRestOperations _loadBalancerRestClient; + private readonly ClientDiagnostics _connectedClusterLoadBalancerLoadBalancersClientDiagnostics; + private readonly LoadBalancersRestOperations _connectedClusterLoadBalancerLoadBalancersRestClient; - /// Initializes a new instance of the class for mocking. - protected LoadBalancerCollection() + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterLoadBalancerCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal LoadBalancerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedClusterLoadBalancerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _loadBalancerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", LoadBalancerResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(LoadBalancerResource.ResourceType, out string loadBalancerApiVersion); - _loadBalancerRestClient = new LoadBalancersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, loadBalancerApiVersion); + _connectedClusterLoadBalancerLoadBalancersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ConnectedClusterLoadBalancerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ConnectedClusterLoadBalancerResource.ResourceType, out string connectedClusterLoadBalancerLoadBalancersApiVersion); + _connectedClusterLoadBalancerLoadBalancersRestClient = new LoadBalancersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterLoadBalancerLoadBalancersApiVersion); } /// @@ -58,7 +58,7 @@ internal LoadBalancerCollection(ArmClient client, ResourceIdentifier id) : base( /// /// /// Resource - /// + /// /// /// /// @@ -68,17 +68,17 @@ internal LoadBalancerCollection(ArmClient client, ResourceIdentifier id) : base( /// 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 loadBalancerName, LoadBalancerData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string loadBalancerName, ConnectedClusterLoadBalancerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.CreateOrUpdate"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _loadBalancerRestClient.CreateOrUpdateAsync(Id, loadBalancerName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerOrchestratorRuntimeArmOperation(new LoadBalancerOperationSource(Client), _loadBalancerClientDiagnostics, Pipeline, _loadBalancerRestClient.CreateCreateOrUpdateRequest(Id, loadBalancerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _connectedClusterLoadBalancerLoadBalancersRestClient.CreateOrUpdateAsync(Id, loadBalancerName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterLoadBalancerOperationSource(Client), _connectedClusterLoadBalancerLoadBalancersClientDiagnostics, Pipeline, _connectedClusterLoadBalancerLoadBalancersRestClient.CreateCreateOrUpdateRequest(Id, loadBalancerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -107,7 +107,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Resource - /// + /// /// /// /// @@ -117,17 +117,17 @@ public virtual async Task> CreateOrUpdateAsyn /// 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 loadBalancerName, LoadBalancerData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string loadBalancerName, ConnectedClusterLoadBalancerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.CreateOrUpdate"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerCollection.CreateOrUpdate"); scope.Start(); try { - var response = _loadBalancerRestClient.CreateOrUpdate(Id, loadBalancerName, data, cancellationToken); - var operation = new ContainerOrchestratorRuntimeArmOperation(new LoadBalancerOperationSource(Client), _loadBalancerClientDiagnostics, Pipeline, _loadBalancerRestClient.CreateCreateOrUpdateRequest(Id, loadBalancerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _connectedClusterLoadBalancerLoadBalancersRestClient.CreateOrUpdate(Id, loadBalancerName, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterLoadBalancerOperationSource(Client), _connectedClusterLoadBalancerLoadBalancersClientDiagnostics, Pipeline, _connectedClusterLoadBalancerLoadBalancersRestClient.CreateCreateOrUpdateRequest(Id, loadBalancerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -156,7 +156,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Resource - /// + /// /// /// /// @@ -164,18 +164,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string loadBalancerName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string loadBalancerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.Get"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerCollection.Get"); scope.Start(); try { - var response = await _loadBalancerRestClient.GetAsync(Id, loadBalancerName, cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterLoadBalancerLoadBalancersRestClient.GetAsync(Id, loadBalancerName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterLoadBalancerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -201,7 +201,7 @@ public virtual async Task> GetAsync(string loadBa /// /// /// Resource - /// + /// /// /// /// @@ -209,18 +209,18 @@ public virtual async Task> GetAsync(string loadBa /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string loadBalancerName, CancellationToken cancellationToken = default) + public virtual Response Get(string loadBalancerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.Get"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerCollection.Get"); scope.Start(); try { - var response = _loadBalancerRestClient.Get(Id, loadBalancerName, cancellationToken); + var response = _connectedClusterLoadBalancerLoadBalancersRestClient.Get(Id, loadBalancerName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterLoadBalancerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -246,17 +246,17 @@ public virtual Response Get(string loadBalancerName, Cance /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _loadBalancerRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _loadBalancerRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LoadBalancerResource(Client, LoadBalancerData.DeserializeLoadBalancerData(e)), _loadBalancerClientDiagnostics, Pipeline, "LoadBalancerCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedClusterLoadBalancerLoadBalancersRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterLoadBalancerLoadBalancersRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterLoadBalancerResource(Client, ConnectedClusterLoadBalancerData.DeserializeConnectedClusterLoadBalancerData(e)), _connectedClusterLoadBalancerLoadBalancersClientDiagnostics, Pipeline, "ConnectedClusterLoadBalancerCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -276,17 +276,17 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _loadBalancerRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _loadBalancerRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LoadBalancerResource(Client, LoadBalancerData.DeserializeLoadBalancerData(e)), _loadBalancerClientDiagnostics, Pipeline, "LoadBalancerCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedClusterLoadBalancerLoadBalancersRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterLoadBalancerLoadBalancersRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterLoadBalancerResource(Client, ConnectedClusterLoadBalancerData.DeserializeConnectedClusterLoadBalancerData(e)), _connectedClusterLoadBalancerLoadBalancersClientDiagnostics, Pipeline, "ConnectedClusterLoadBalancerCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -306,7 +306,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Resource - /// + /// /// /// /// @@ -318,11 +318,11 @@ public virtual async Task> ExistsAsync(string loadBalancerName, C { Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.Exists"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerCollection.Exists"); scope.Start(); try { - var response = await _loadBalancerRestClient.GetAsync(Id, loadBalancerName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterLoadBalancerLoadBalancersRestClient.GetAsync(Id, loadBalancerName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -349,7 +349,7 @@ public virtual async Task> ExistsAsync(string loadBalancerName, C /// /// /// Resource - /// + /// /// /// /// @@ -361,11 +361,11 @@ public virtual Response Exists(string loadBalancerName, CancellationToken { Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.Exists"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerCollection.Exists"); scope.Start(); try { - var response = _loadBalancerRestClient.Get(Id, loadBalancerName, cancellationToken: cancellationToken); + var response = _connectedClusterLoadBalancerLoadBalancersRestClient.Get(Id, loadBalancerName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -392,7 +392,7 @@ public virtual Response Exists(string loadBalancerName, CancellationToken /// /// /// Resource - /// + /// /// /// /// @@ -400,18 +400,18 @@ public virtual Response Exists(string loadBalancerName, CancellationToken /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string loadBalancerName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string loadBalancerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.GetIfExists"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerCollection.GetIfExists"); scope.Start(); try { - var response = await _loadBalancerRestClient.GetAsync(Id, loadBalancerName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterLoadBalancerLoadBalancersRestClient.GetAsync(Id, loadBalancerName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterLoadBalancerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -437,7 +437,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Resource - /// + /// /// /// /// @@ -445,18 +445,18 @@ public virtual async Task> GetIfExistsAsy /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string loadBalancerName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string loadBalancerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerCollection.GetIfExists"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerCollection.GetIfExists"); scope.Start(); try { - var response = _loadBalancerRestClient.Get(Id, loadBalancerName, cancellationToken: cancellationToken); + var response = _connectedClusterLoadBalancerLoadBalancersRestClient.Get(Id, loadBalancerName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterLoadBalancerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -465,7 +465,7 @@ public virtual NullableResponse GetIfExists(string loadBal } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -475,7 +475,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.Serialization.cs similarity index 75% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.Serialization.cs index bcdc8383751dc..77511c171a9b7 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.Serialization.cs @@ -15,39 +15,28 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { - public partial class LoadBalancerData : IUtf8JsonSerializable, IJsonModel + public partial class ConnectedClusterLoadBalancerData : 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; + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LoadBalancerData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterLoadBalancerData)} 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); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsCollectionDefined(Addresses)) @@ -92,37 +81,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteStringValue(ProvisioningState.Value.ToString()); } 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(); } - LoadBalancerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ConnectedClusterLoadBalancerData 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(LoadBalancerData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterLoadBalancerData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLoadBalancerData(document.RootElement, options); + return DeserializeConnectedClusterLoadBalancerData(document.RootElement, options); } - internal static LoadBalancerData DeserializeLoadBalancerData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ConnectedClusterLoadBalancerData DeserializeConnectedClusterLoadBalancerData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -245,7 +218,7 @@ internal static LoadBalancerData DeserializeLoadBalancerData(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new LoadBalancerData( + return new ConnectedClusterLoadBalancerData( id, name, type, @@ -258,35 +231,35 @@ internal static LoadBalancerData DeserializeLoadBalancerData(JsonElement element 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(LoadBalancerData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterLoadBalancerData)} does not support writing '{options.Format}' format."); } } - LoadBalancerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ConnectedClusterLoadBalancerData 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 DeserializeLoadBalancerData(document.RootElement, options); + return DeserializeConnectedClusterLoadBalancerData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LoadBalancerData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterLoadBalancerData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.cs similarity index 83% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.cs index b30ceca98d68a..8550dfa7a8a06 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// A class representing the LoadBalancer data model. + /// A class representing the ConnectedClusterLoadBalancer data model. /// A LoadBalancer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) /// - public partial class LoadBalancerData : ResourceData + public partial class ConnectedClusterLoadBalancerData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,15 +51,15 @@ public partial class LoadBalancerData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LoadBalancerData() + /// Initializes a new instance of . + public ConnectedClusterLoadBalancerData() { Addresses = new ChangeTrackingList(); ServiceSelector = new ChangeTrackingDictionary(); BgpPeers = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -70,7 +70,7 @@ public LoadBalancerData() /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal LoadBalancerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList addresses, IDictionary serviceSelector, AdvertiseMode? advertiseMode, IList bgpPeers, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ConnectedClusterLoadBalancerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList addresses, IDictionary serviceSelector, AdvertiseMode? advertiseMode, IList bgpPeers, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Addresses = addresses; ServiceSelector = serviceSelector; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerResource.Serialization.cs new file mode 100644 index 0000000000000..336ca9b2de4ea --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerResource.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.ContainerOrchestratorRuntime +{ + public partial class ConnectedClusterLoadBalancerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectedClusterLoadBalancerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ConnectedClusterLoadBalancerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerResource.cs similarity index 68% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerResource.cs index e7ff7234da2e4..feb298313a85f 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerResource.cs @@ -15,14 +15,14 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// A Class representing a LoadBalancer 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 GetLoadBalancerResource method. - /// Otherwise you can get one from its parent resource using the GetLoadBalancer method. + /// A Class representing a ConnectedClusterLoadBalancer 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 GetConnectedClusterLoadBalancerResource method. + /// Otherwise you can get one from its parent resource using the GetConnectedClusterLoadBalancer method. /// - public partial class LoadBalancerResource : ArmResource + public partial class ConnectedClusterLoadBalancerResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The resourceUri. /// The loadBalancerName. public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string loadBalancerName) @@ -31,35 +31,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, st return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _loadBalancerClientDiagnostics; - private readonly LoadBalancersRestOperations _loadBalancerRestClient; - private readonly LoadBalancerData _data; + private readonly ClientDiagnostics _connectedClusterLoadBalancerLoadBalancersClientDiagnostics; + private readonly LoadBalancersRestOperations _connectedClusterLoadBalancerLoadBalancersRestClient; + private readonly ConnectedClusterLoadBalancerData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.KubernetesRuntime/loadBalancers"; - /// Initializes a new instance of the class for mocking. - protected LoadBalancerResource() + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterLoadBalancerResource() { } - /// 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 LoadBalancerResource(ArmClient client, LoadBalancerData data) : this(client, data.Id) + internal ConnectedClusterLoadBalancerResource(ArmClient client, ConnectedClusterLoadBalancerData 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 LoadBalancerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedClusterLoadBalancerResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _loadBalancerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string loadBalancerApiVersion); - _loadBalancerRestClient = new LoadBalancersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, loadBalancerApiVersion); + _connectedClusterLoadBalancerLoadBalancersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string connectedClusterLoadBalancerLoadBalancersApiVersion); + _connectedClusterLoadBalancerLoadBalancersRestClient = new LoadBalancersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterLoadBalancerLoadBalancersApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -70,7 +70,7 @@ internal LoadBalancerResource(ArmClient client, ResourceIdentifier id) : base(cl /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual LoadBalancerData Data + public virtual ConnectedClusterLoadBalancerData Data { get { @@ -103,21 +103,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// 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 = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Get"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerResource.Get"); scope.Start(); try { - var response = await _loadBalancerRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterLoadBalancerLoadBalancersRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterLoadBalancerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -143,21 +143,21 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Get"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerResource.Get"); scope.Start(); try { - var response = _loadBalancerRestClient.Get(Id.Parent, Id.Name, cancellationToken); + var response = _connectedClusterLoadBalancerLoadBalancersRestClient.Get(Id.Parent, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LoadBalancerResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterLoadBalancerResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Resource - /// + /// /// /// /// @@ -191,12 +191,12 @@ public virtual Response Get(CancellationToken cancellation /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Delete"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerResource.Delete"); scope.Start(); try { - var response = await _loadBalancerRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _loadBalancerRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var response = await _connectedClusterLoadBalancerLoadBalancersRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _connectedClusterLoadBalancerLoadBalancersRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -235,12 +235,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 = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Delete"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerResource.Delete"); scope.Start(); try { - var response = _loadBalancerRestClient.Delete(Id.Parent, Id.Name, cancellationToken); - var uri = _loadBalancerRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var response = _connectedClusterLoadBalancerLoadBalancersRestClient.Delete(Id.Parent, Id.Name, cancellationToken); + var uri = _connectedClusterLoadBalancerLoadBalancersRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -279,16 +279,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// Resource create parameters. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, LoadBalancerData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ConnectedClusterLoadBalancerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Update"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerResource.Update"); scope.Start(); try { - var response = await _loadBalancerRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerOrchestratorRuntimeArmOperation(new LoadBalancerOperationSource(Client), _loadBalancerClientDiagnostics, Pipeline, _loadBalancerRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _connectedClusterLoadBalancerLoadBalancersRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterLoadBalancerOperationSource(Client), _connectedClusterLoadBalancerLoadBalancersClientDiagnostics, Pipeline, _connectedClusterLoadBalancerLoadBalancersRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -317,7 +317,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Resource - /// + /// /// /// /// @@ -325,16 +325,16 @@ public virtual async Task> UpdateAsync(WaitUn /// Resource create parameters. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, LoadBalancerData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ConnectedClusterLoadBalancerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _loadBalancerClientDiagnostics.CreateScope("LoadBalancerResource.Update"); + using var scope = _connectedClusterLoadBalancerLoadBalancersClientDiagnostics.CreateScope("ConnectedClusterLoadBalancerResource.Update"); scope.Start(); try { - var response = _loadBalancerRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ContainerOrchestratorRuntimeArmOperation(new LoadBalancerOperationSource(Client), _loadBalancerClientDiagnostics, Pipeline, _loadBalancerRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _connectedClusterLoadBalancerLoadBalancersRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterLoadBalancerOperationSource(Client), _connectedClusterLoadBalancerLoadBalancersClientDiagnostics, Pipeline, _connectedClusterLoadBalancerLoadBalancersRestClient.CreateCreateOrUpdateRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceCollection.cs similarity index 65% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceCollection.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceCollection.cs index 7efbb57f6d322..dfe50818ad91d 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceCollection.cs @@ -17,28 +17,28 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// 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 GetServiceResources method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetConnectedClusterServices method from an instance of . /// - public partial class ServiceResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ConnectedClusterServiceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _serviceResourceServicesClientDiagnostics; - private readonly ServicesRestOperations _serviceResourceServicesRestClient; + private readonly ClientDiagnostics _connectedClusterServiceServicesClientDiagnostics; + private readonly ServicesRestOperations _connectedClusterServiceServicesRestClient; - /// Initializes a new instance of the class for mocking. - protected ServiceResourceCollection() + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterServiceCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal ServiceResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedClusterServiceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _serviceResourceServicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ServiceResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ServiceResource.ResourceType, out string serviceResourceServicesApiVersion); - _serviceResourceServicesRestClient = new ServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceResourceServicesApiVersion); + _connectedClusterServiceServicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ConnectedClusterServiceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ConnectedClusterServiceResource.ResourceType, out string connectedClusterServiceServicesApiVersion); + _connectedClusterServiceServicesRestClient = new ServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterServiceServicesApiVersion); } /// @@ -58,7 +58,7 @@ internal ServiceResourceCollection(ArmClient client, ResourceIdentifier id) : ba /// /// /// Resource - /// + /// /// /// /// @@ -68,19 +68,19 @@ internal ServiceResourceCollection(ArmClient client, ResourceIdentifier id) : ba /// 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 serviceName, ServiceResourceData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string serviceName, ConnectedClusterServiceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.CreateOrUpdate"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _serviceResourceServicesRestClient.CreateOrUpdateAsync(Id, serviceName, data, cancellationToken).ConfigureAwait(false); - var uri = _serviceResourceServicesRestClient.CreateCreateOrUpdateRequestUri(Id, serviceName, data); + var response = await _connectedClusterServiceServicesRestClient.CreateOrUpdateAsync(Id, serviceName, data, cancellationToken).ConfigureAwait(false); + var uri = _connectedClusterServiceServicesRestClient.CreateCreateOrUpdateRequestUri(Id, serviceName, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ConnectedClusterServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -109,7 +109,7 @@ public virtual async Task> CreateOrUpdateAsync(Wai /// /// /// Resource - /// + /// /// /// /// @@ -119,19 +119,19 @@ public virtual async Task> CreateOrUpdateAsync(Wai /// 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 serviceName, ServiceResourceData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string serviceName, ConnectedClusterServiceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.CreateOrUpdate"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceCollection.CreateOrUpdate"); scope.Start(); try { - var response = _serviceResourceServicesRestClient.CreateOrUpdate(Id, serviceName, data, cancellationToken); - var uri = _serviceResourceServicesRestClient.CreateCreateOrUpdateRequestUri(Id, serviceName, data); + var response = _connectedClusterServiceServicesRestClient.CreateOrUpdate(Id, serviceName, data, cancellationToken); + var uri = _connectedClusterServiceServicesRestClient.CreateCreateOrUpdateRequestUri(Id, serviceName, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ConnectedClusterServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -160,7 +160,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, /// /// /// Resource - /// + /// /// /// /// @@ -168,18 +168,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string serviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.Get"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceCollection.Get"); scope.Start(); try { - var response = await _serviceResourceServicesRestClient.GetAsync(Id, serviceName, cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterServiceServicesRestClient.GetAsync(Id, serviceName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterServiceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -205,7 +205,7 @@ public virtual async Task> GetAsync(string serviceName /// /// /// Resource - /// + /// /// /// /// @@ -213,18 +213,18 @@ public virtual async Task> GetAsync(string serviceName /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string serviceName, CancellationToken cancellationToken = default) + public virtual Response Get(string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.Get"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceCollection.Get"); scope.Start(); try { - var response = _serviceResourceServicesRestClient.Get(Id, serviceName, cancellationToken); + var response = _connectedClusterServiceServicesRestClient.Get(Id, serviceName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterServiceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -250,17 +250,17 @@ public virtual Response Get(string serviceName, CancellationTok /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _serviceResourceServicesRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceResourceServicesRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceResource(Client, ServiceResourceData.DeserializeServiceResourceData(e)), _serviceResourceServicesClientDiagnostics, Pipeline, "ServiceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedClusterServiceServicesRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterServiceServicesRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterServiceResource(Client, ConnectedClusterServiceData.DeserializeConnectedClusterServiceData(e)), _connectedClusterServiceServicesClientDiagnostics, Pipeline, "ConnectedClusterServiceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -280,17 +280,17 @@ public virtual AsyncPageable GetAllAsync(CancellationToken canc /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _serviceResourceServicesRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceResourceServicesRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceResource(Client, ServiceResourceData.DeserializeServiceResourceData(e)), _serviceResourceServicesClientDiagnostics, Pipeline, "ServiceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedClusterServiceServicesRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterServiceServicesRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterServiceResource(Client, ConnectedClusterServiceData.DeserializeConnectedClusterServiceData(e)), _connectedClusterServiceServicesClientDiagnostics, Pipeline, "ConnectedClusterServiceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -310,7 +310,7 @@ public virtual Pageable GetAll(CancellationToken cancellationTo /// /// /// Resource - /// + /// /// /// /// @@ -322,11 +322,11 @@ public virtual async Task> ExistsAsync(string serviceName, Cancel { Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.Exists"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceCollection.Exists"); scope.Start(); try { - var response = await _serviceResourceServicesRestClient.GetAsync(Id, serviceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterServiceServicesRestClient.GetAsync(Id, serviceName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string serviceName, Cancel /// /// /// Resource - /// + /// /// /// /// @@ -365,11 +365,11 @@ public virtual Response Exists(string serviceName, CancellationToken cance { Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.Exists"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceCollection.Exists"); scope.Start(); try { - var response = _serviceResourceServicesRestClient.Get(Id, serviceName, cancellationToken: cancellationToken); + var response = _connectedClusterServiceServicesRestClient.Get(Id, serviceName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -396,7 +396,7 @@ public virtual Response Exists(string serviceName, CancellationToken cance /// /// /// Resource - /// + /// /// /// /// @@ -404,18 +404,18 @@ public virtual Response Exists(string serviceName, CancellationToken cance /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string serviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.GetIfExists"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceCollection.GetIfExists"); scope.Start(); try { - var response = await _serviceResourceServicesRestClient.GetAsync(Id, serviceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterServiceServicesRestClient.GetAsync(Id, serviceName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterServiceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -441,7 +441,7 @@ public virtual async Task> GetIfExistsAsync(st /// /// /// Resource - /// + /// /// /// /// @@ -449,18 +449,18 @@ public virtual async Task> GetIfExistsAsync(st /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string serviceName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResourceCollection.GetIfExists"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceCollection.GetIfExists"); scope.Start(); try { - var response = _serviceResourceServicesRestClient.Get(Id, serviceName, cancellationToken: cancellationToken); + var response = _connectedClusterServiceServicesRestClient.Get(Id, serviceName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterServiceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -469,7 +469,7 @@ public virtual NullableResponse GetIfExists(string serviceName, } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -479,7 +479,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.Serialization.cs similarity index 65% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.Serialization.cs index 9a28ad461090b..4fad1e2caed3a 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.Serialization.cs @@ -15,39 +15,28 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { - public partial class ServiceResourceData : IUtf8JsonSerializable, IJsonModel + public partial class ConnectedClusterServiceData : 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; + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ServiceResourceData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterServiceData)} 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); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(RpObjectId)) @@ -61,37 +50,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteStringValue(ProvisioningState.Value.ToString()); } 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(); } - ServiceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ConnectedClusterServiceData 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(ServiceResourceData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterServiceData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeServiceResourceData(document.RootElement, options); + return DeserializeConnectedClusterServiceData(document.RootElement, options); } - internal static ServiceResourceData DeserializeServiceResourceData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ConnectedClusterServiceData DeserializeConnectedClusterServiceData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -169,7 +142,7 @@ internal static ServiceResourceData DeserializeServiceResourceData(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new ServiceResourceData( + return new ConnectedClusterServiceData( id, name, type, @@ -179,35 +152,35 @@ internal static ServiceResourceData DeserializeServiceResourceData(JsonElement e 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(ServiceResourceData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterServiceData)} does not support writing '{options.Format}' format."); } } - ServiceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ConnectedClusterServiceData 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 DeserializeServiceResourceData(document.RootElement, options); + return DeserializeConnectedClusterServiceData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ServiceResourceData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterServiceData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.cs similarity index 80% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.cs index 223211e14c7dd..082afa6358563 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResourceData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// A class representing the ServiceResource data model. + /// A class representing the ConnectedClusterService data model. /// A Service resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) /// - public partial class ServiceResourceData : ResourceData + public partial class ConnectedClusterServiceData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,12 +51,12 @@ public partial class ServiceResourceData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ServiceResourceData() + /// Initializes a new instance of . + public ConnectedClusterServiceData() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -64,7 +64,7 @@ public ServiceResourceData() /// The object id of the service principal of the RP provisioned in the tenant. /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal ServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? rpObjectId, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ConnectedClusterServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? rpObjectId, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { RpObjectId = rpObjectId; ProvisioningState = provisioningState; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceResource.Serialization.cs new file mode 100644 index 0000000000000..9d6e34cb7fd66 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceResource.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.ContainerOrchestratorRuntime +{ + public partial class ConnectedClusterServiceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectedClusterServiceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ConnectedClusterServiceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceResource.cs similarity index 70% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceResource.cs index 5b0ea5aa01744..a329e88f01e8a 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceResource.cs @@ -15,14 +15,14 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// A Class representing a ServiceResource 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 GetServiceResource method. - /// Otherwise you can get one from its parent resource using the GetServiceResource method. + /// A Class representing a ConnectedClusterService 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 GetConnectedClusterServiceResource method. + /// Otherwise you can get one from its parent resource using the GetConnectedClusterService method. /// - public partial class ServiceResource : ArmResource + public partial class ConnectedClusterServiceResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The resourceUri. /// The serviceName. public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string serviceName) @@ -31,35 +31,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, st return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _serviceResourceServicesClientDiagnostics; - private readonly ServicesRestOperations _serviceResourceServicesRestClient; - private readonly ServiceResourceData _data; + private readonly ClientDiagnostics _connectedClusterServiceServicesClientDiagnostics; + private readonly ServicesRestOperations _connectedClusterServiceServicesRestClient; + private readonly ConnectedClusterServiceData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.KubernetesRuntime/services"; - /// Initializes a new instance of the class for mocking. - protected ServiceResource() + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterServiceResource() { } - /// 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 ServiceResource(ArmClient client, ServiceResourceData data) : this(client, data.Id) + internal ConnectedClusterServiceResource(ArmClient client, ConnectedClusterServiceData 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 ServiceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedClusterServiceResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _serviceResourceServicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string serviceResourceServicesApiVersion); - _serviceResourceServicesRestClient = new ServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceResourceServicesApiVersion); + _connectedClusterServiceServicesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string connectedClusterServiceServicesApiVersion); + _connectedClusterServiceServicesRestClient = new ServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterServiceServicesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -70,7 +70,7 @@ internal ServiceResource(ArmClient client, ResourceIdentifier id) : base(client, /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ServiceResourceData Data + public virtual ConnectedClusterServiceData Data { get { @@ -103,21 +103,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// 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 = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Get"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceResource.Get"); scope.Start(); try { - var response = await _serviceResourceServicesRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterServiceServicesRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterServiceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -143,21 +143,21 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Get"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceResource.Get"); scope.Start(); try { - var response = _serviceResourceServicesRestClient.Get(Id.Parent, Id.Name, cancellationToken); + var response = _connectedClusterServiceServicesRestClient.Get(Id.Parent, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ServiceResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterServiceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationToken /// /// /// Resource - /// + /// /// /// /// @@ -191,12 +191,12 @@ public virtual Response Get(CancellationToken cancellationToken /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Delete"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceResource.Delete"); scope.Start(); try { - var response = await _serviceResourceServicesRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _serviceResourceServicesRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var response = await _connectedClusterServiceServicesRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _connectedClusterServiceServicesRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -235,12 +235,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 = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Delete"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceResource.Delete"); scope.Start(); try { - var response = _serviceResourceServicesRestClient.Delete(Id.Parent, Id.Name, cancellationToken); - var uri = _serviceResourceServicesRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); + var response = _connectedClusterServiceServicesRestClient.Delete(Id.Parent, Id.Name, cancellationToken); + var uri = _connectedClusterServiceServicesRestClient.CreateDeleteRequestUri(Id.Parent, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new ContainerOrchestratorRuntimeArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -279,18 +279,18 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// Resource create parameters. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ServiceResourceData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ConnectedClusterServiceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Update"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceResource.Update"); scope.Start(); try { - var response = await _serviceResourceServicesRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var uri = _serviceResourceServicesRestClient.CreateCreateOrUpdateRequestUri(Id.Parent, Id.Name, data); + var response = await _connectedClusterServiceServicesRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _connectedClusterServiceServicesRestClient.CreateCreateOrUpdateRequestUri(Id.Parent, Id.Name, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ConnectedClusterServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -319,7 +319,7 @@ public virtual async Task> UpdateAsync(WaitUntil w /// /// /// Resource - /// + /// /// /// /// @@ -327,18 +327,18 @@ public virtual async Task> UpdateAsync(WaitUntil w /// Resource create parameters. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ServiceResourceData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ConnectedClusterServiceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _serviceResourceServicesClientDiagnostics.CreateScope("ServiceResource.Update"); + using var scope = _connectedClusterServiceServicesClientDiagnostics.CreateScope("ConnectedClusterServiceResource.Update"); scope.Start(); try { - var response = _serviceResourceServicesRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); - var uri = _serviceResourceServicesRestClient.CreateCreateOrUpdateRequestUri(Id.Parent, Id.Name, data); + var response = _connectedClusterServiceServicesRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); + var uri = _connectedClusterServiceServicesRestClient.CreateCreateOrUpdateRequestUri(Id.Parent, Id.Name, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(Response.FromValue(new ConnectedClusterServiceResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassCollection.cs similarity index 64% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceCollection.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassCollection.cs index 7c1f5b762300a..7b44dc851013b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassCollection.cs @@ -17,28 +17,28 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// 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 GetStorageClassResources method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetConnectedClusterStorageClasses method from an instance of . /// - public partial class StorageClassResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ConnectedClusterStorageClassCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _storageClassResourceStorageClassClientDiagnostics; - private readonly StorageClassRestOperations _storageClassResourceStorageClassRestClient; + private readonly ClientDiagnostics _connectedClusterStorageClassStorageClassClientDiagnostics; + private readonly StorageClassRestOperations _connectedClusterStorageClassStorageClassRestClient; - /// Initializes a new instance of the class for mocking. - protected StorageClassResourceCollection() + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterStorageClassCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal StorageClassResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedClusterStorageClassCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _storageClassResourceStorageClassClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", StorageClassResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(StorageClassResource.ResourceType, out string storageClassResourceStorageClassApiVersion); - _storageClassResourceStorageClassRestClient = new StorageClassRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, storageClassResourceStorageClassApiVersion); + _connectedClusterStorageClassStorageClassClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ConnectedClusterStorageClassResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ConnectedClusterStorageClassResource.ResourceType, out string connectedClusterStorageClassStorageClassApiVersion); + _connectedClusterStorageClassStorageClassRestClient = new StorageClassRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterStorageClassStorageClassApiVersion); } /// @@ -58,7 +58,7 @@ internal StorageClassResourceCollection(ArmClient client, ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// @@ -68,17 +68,17 @@ internal StorageClassResourceCollection(ArmClient client, ResourceIdentifier id) /// 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 storageClassName, StorageClassResourceData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string storageClassName, ConnectedClusterStorageClassData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.CreateOrUpdate"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _storageClassResourceStorageClassRestClient.CreateOrUpdateAsync(Id, storageClassName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerOrchestratorRuntimeArmOperation(new StorageClassResourceOperationSource(Client), _storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateCreateOrUpdateRequest(Id, storageClassName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _connectedClusterStorageClassStorageClassRestClient.CreateOrUpdateAsync(Id, storageClassName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterStorageClassOperationSource(Client), _connectedClusterStorageClassStorageClassClientDiagnostics, Pipeline, _connectedClusterStorageClassStorageClassRestClient.CreateCreateOrUpdateRequest(Id, storageClassName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -107,7 +107,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Resource - /// + /// /// /// /// @@ -117,17 +117,17 @@ public virtual async Task> CreateOrUpdateAsyn /// 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 storageClassName, StorageClassResourceData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string storageClassName, ConnectedClusterStorageClassData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.CreateOrUpdate"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassCollection.CreateOrUpdate"); scope.Start(); try { - var response = _storageClassResourceStorageClassRestClient.CreateOrUpdate(Id, storageClassName, data, cancellationToken); - var operation = new ContainerOrchestratorRuntimeArmOperation(new StorageClassResourceOperationSource(Client), _storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateCreateOrUpdateRequest(Id, storageClassName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _connectedClusterStorageClassStorageClassRestClient.CreateOrUpdate(Id, storageClassName, data, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterStorageClassOperationSource(Client), _connectedClusterStorageClassStorageClassClientDiagnostics, Pipeline, _connectedClusterStorageClassStorageClassRestClient.CreateCreateOrUpdateRequest(Id, storageClassName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -156,7 +156,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Resource - /// + /// /// /// /// @@ -164,18 +164,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string storageClassName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.Get"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassCollection.Get"); scope.Start(); try { - var response = await _storageClassResourceStorageClassRestClient.GetAsync(Id, storageClassName, cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterStorageClassStorageClassRestClient.GetAsync(Id, storageClassName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterStorageClassResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -201,7 +201,7 @@ public virtual async Task> GetAsync(string storag /// /// /// Resource - /// + /// /// /// /// @@ -209,18 +209,18 @@ public virtual async Task> GetAsync(string storag /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string storageClassName, CancellationToken cancellationToken = default) + public virtual Response Get(string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.Get"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassCollection.Get"); scope.Start(); try { - var response = _storageClassResourceStorageClassRestClient.Get(Id, storageClassName, cancellationToken); + var response = _connectedClusterStorageClassStorageClassRestClient.Get(Id, storageClassName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterStorageClassResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -246,17 +246,17 @@ public virtual Response Get(string storageClassName, Cance /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _storageClassResourceStorageClassRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _storageClassResourceStorageClassRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageClassResource(Client, StorageClassResourceData.DeserializeStorageClassResourceData(e)), _storageClassResourceStorageClassClientDiagnostics, Pipeline, "StorageClassResourceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedClusterStorageClassStorageClassRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterStorageClassStorageClassRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterStorageClassResource(Client, ConnectedClusterStorageClassData.DeserializeConnectedClusterStorageClassData(e)), _connectedClusterStorageClassStorageClassClientDiagnostics, Pipeline, "ConnectedClusterStorageClassCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -276,17 +276,17 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _storageClassResourceStorageClassRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _storageClassResourceStorageClassRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageClassResource(Client, StorageClassResourceData.DeserializeStorageClassResourceData(e)), _storageClassResourceStorageClassClientDiagnostics, Pipeline, "StorageClassResourceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedClusterStorageClassStorageClassRestClient.CreateListRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterStorageClassStorageClassRestClient.CreateListNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterStorageClassResource(Client, ConnectedClusterStorageClassData.DeserializeConnectedClusterStorageClassData(e)), _connectedClusterStorageClassStorageClassClientDiagnostics, Pipeline, "ConnectedClusterStorageClassCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -306,7 +306,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Resource - /// + /// /// /// /// @@ -318,11 +318,11 @@ public virtual async Task> ExistsAsync(string storageClassName, C { Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.Exists"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassCollection.Exists"); scope.Start(); try { - var response = await _storageClassResourceStorageClassRestClient.GetAsync(Id, storageClassName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterStorageClassStorageClassRestClient.GetAsync(Id, storageClassName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -349,7 +349,7 @@ public virtual async Task> ExistsAsync(string storageClassName, C /// /// /// Resource - /// + /// /// /// /// @@ -361,11 +361,11 @@ public virtual Response Exists(string storageClassName, CancellationToken { Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.Exists"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassCollection.Exists"); scope.Start(); try { - var response = _storageClassResourceStorageClassRestClient.Get(Id, storageClassName, cancellationToken: cancellationToken); + var response = _connectedClusterStorageClassStorageClassRestClient.Get(Id, storageClassName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -392,7 +392,7 @@ public virtual Response Exists(string storageClassName, CancellationToken /// /// /// Resource - /// + /// /// /// /// @@ -400,18 +400,18 @@ public virtual Response Exists(string storageClassName, CancellationToken /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string storageClassName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.GetIfExists"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassCollection.GetIfExists"); scope.Start(); try { - var response = await _storageClassResourceStorageClassRestClient.GetAsync(Id, storageClassName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterStorageClassStorageClassRestClient.GetAsync(Id, storageClassName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterStorageClassResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -437,7 +437,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Resource - /// + /// /// /// /// @@ -445,18 +445,18 @@ public virtual async Task> GetIfExistsAsy /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string storageClassName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResourceCollection.GetIfExists"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassCollection.GetIfExists"); scope.Start(); try { - var response = _storageClassResourceStorageClassRestClient.Get(Id, storageClassName, cancellationToken: cancellationToken); + var response = _connectedClusterStorageClassStorageClassRestClient.Get(Id, storageClassName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterStorageClassResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -465,7 +465,7 @@ public virtual NullableResponse GetIfExists(string storage } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -475,7 +475,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.Serialization.cs similarity index 81% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.Serialization.cs index 9cb097fd6066c..087fe4bf1dd81 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.Serialization.cs @@ -15,39 +15,28 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { - public partial class StorageClassResourceData : IUtf8JsonSerializable, IJsonModel + public partial class ConnectedClusterStorageClassData : 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; + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(StorageClassResourceData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassData)} 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); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(AllowVolumeExpansion)) @@ -126,37 +115,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteStringValue(ProvisioningState.Value.ToString()); } 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(); } - StorageClassResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ConnectedClusterStorageClassData 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(StorageClassResourceData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageClassResourceData(document.RootElement, options); + return DeserializeConnectedClusterStorageClassData(document.RootElement, options); } - internal static StorageClassResourceData DeserializeStorageClassResourceData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ConnectedClusterStorageClassData DeserializeConnectedClusterStorageClassData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -345,7 +318,7 @@ internal static StorageClassResourceData DeserializeStorageClassResourceData(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new StorageClassResourceData( + return new ConnectedClusterStorageClassData( id, name, type, @@ -365,35 +338,35 @@ internal static StorageClassResourceData DeserializeStorageClassResourceData(Jso 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(StorageClassResourceData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassData)} does not support writing '{options.Format}' format."); } } - StorageClassResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ConnectedClusterStorageClassData 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 DeserializeStorageClassResourceData(document.RootElement, options); + return DeserializeConnectedClusterStorageClassData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(StorageClassResourceData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.cs similarity index 86% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.cs index f692ea5d803ad..a8010a10aa6ac 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResourceData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// A class representing the StorageClassResource data model. + /// A class representing the ConnectedClusterStorageClass data model. /// A StorageClass resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) /// - public partial class StorageClassResourceData : ResourceData + public partial class ConnectedClusterStorageClassData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,15 +51,15 @@ public partial class StorageClassResourceData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public StorageClassResourceData() + /// Initializes a new instance of . + public ConnectedClusterStorageClassData() { MountOptions = new ChangeTrackingList(); AccessModes = new ChangeTrackingList(); Limitations = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -81,7 +81,7 @@ public StorageClassResourceData() /// /// Resource provision state. /// Keeps track of any properties unknown to the library. - internal StorageClassResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeExpansion? allowVolumeExpansion, IList mountOptions, string provisioner, VolumeBindingMode? volumeBindingMode, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypeProperties typeProperties, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ConnectedClusterStorageClassData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeExpansion? allowVolumeExpansion, IList mountOptions, string provisioner, VolumeBindingMode? volumeBindingMode, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypeProperties typeProperties, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { AllowVolumeExpansion = allowVolumeExpansion; MountOptions = mountOptions; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassResource.Serialization.cs new file mode 100644 index 0000000000000..6eb02c25c1943 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassResource.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.ContainerOrchestratorRuntime +{ + public partial class ConnectedClusterStorageClassResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectedClusterStorageClassData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ConnectedClusterStorageClassData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassResource.cs similarity index 67% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassResource.cs index 478b6eb03d809..c9858413d246c 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassResource.cs @@ -16,14 +16,14 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { /// - /// A Class representing a StorageClassResource 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 GetStorageClassResource method. - /// Otherwise you can get one from its parent resource using the GetStorageClassResource method. + /// A Class representing a ConnectedClusterStorageClass 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 GetConnectedClusterStorageClassResource method. + /// Otherwise you can get one from its parent resource using the GetConnectedClusterStorageClass method. /// - public partial class StorageClassResource : ArmResource + public partial class ConnectedClusterStorageClassResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The resourceUri. /// The storageClassName. public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, string storageClassName) @@ -32,35 +32,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string resourceUri, st return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _storageClassResourceStorageClassClientDiagnostics; - private readonly StorageClassRestOperations _storageClassResourceStorageClassRestClient; - private readonly StorageClassResourceData _data; + private readonly ClientDiagnostics _connectedClusterStorageClassStorageClassClientDiagnostics; + private readonly StorageClassRestOperations _connectedClusterStorageClassStorageClassRestClient; + private readonly ConnectedClusterStorageClassData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.KubernetesRuntime/storageClasses"; - /// Initializes a new instance of the class for mocking. - protected StorageClassResource() + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterStorageClassResource() { } - /// 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 StorageClassResource(ArmClient client, StorageClassResourceData data) : this(client, data.Id) + internal ConnectedClusterStorageClassResource(ArmClient client, ConnectedClusterStorageClassData 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 StorageClassResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedClusterStorageClassResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _storageClassResourceStorageClassClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string storageClassResourceStorageClassApiVersion); - _storageClassResourceStorageClassRestClient = new StorageClassRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, storageClassResourceStorageClassApiVersion); + _connectedClusterStorageClassStorageClassClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerOrchestratorRuntime", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string connectedClusterStorageClassStorageClassApiVersion); + _connectedClusterStorageClassStorageClassRestClient = new StorageClassRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterStorageClassStorageClassApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -71,7 +71,7 @@ internal StorageClassResource(ArmClient client, ResourceIdentifier id) : base(cl /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual StorageClassResourceData Data + public virtual ConnectedClusterStorageClassData Data { get { @@ -104,21 +104,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// 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 = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Get"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassResource.Get"); scope.Start(); try { - var response = await _storageClassResourceStorageClassRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _connectedClusterStorageClassStorageClassRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterStorageClassResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -144,21 +144,21 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Get"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassResource.Get"); scope.Start(); try { - var response = _storageClassResourceStorageClassRestClient.Get(Id.Parent, Id.Name, cancellationToken); + var response = _connectedClusterStorageClassStorageClassRestClient.Get(Id.Parent, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new StorageClassResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterStorageClassResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Resource - /// + /// /// /// /// @@ -192,12 +192,12 @@ public virtual Response Get(CancellationToken cancellation /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Delete"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassResource.Delete"); scope.Start(); try { - var response = await _storageClassResourceStorageClassRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerOrchestratorRuntimeArmOperation(_storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _connectedClusterStorageClassStorageClassRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(_connectedClusterStorageClassStorageClassClientDiagnostics, Pipeline, _connectedClusterStorageClassStorageClassRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -234,12 +234,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 = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Delete"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassResource.Delete"); scope.Start(); try { - var response = _storageClassResourceStorageClassRestClient.Delete(Id.Parent, Id.Name, cancellationToken); - var operation = new ContainerOrchestratorRuntimeArmOperation(_storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _connectedClusterStorageClassStorageClassRestClient.Delete(Id.Parent, Id.Name, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(_connectedClusterStorageClassStorageClassClientDiagnostics, Pipeline, _connectedClusterStorageClassStorageClassRestClient.CreateDeleteRequest(Id.Parent, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -276,16 +276,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, StorageClassResourcePatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ConnectedClusterStorageClassPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Update"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassResource.Update"); scope.Start(); try { - var response = await _storageClassResourceStorageClassRestClient.UpdateAsync(Id.Parent, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerOrchestratorRuntimeArmOperation(new StorageClassResourceOperationSource(Client), _storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _connectedClusterStorageClassStorageClassRestClient.UpdateAsync(Id.Parent, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterStorageClassOperationSource(Client), _connectedClusterStorageClassStorageClassClientDiagnostics, Pipeline, _connectedClusterStorageClassStorageClassRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -314,7 +314,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Resource - /// + /// /// /// /// @@ -322,16 +322,16 @@ public virtual async Task> UpdateAsync(WaitUn /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, StorageClassResourcePatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ConnectedClusterStorageClassPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _storageClassResourceStorageClassClientDiagnostics.CreateScope("StorageClassResource.Update"); + using var scope = _connectedClusterStorageClassStorageClassClientDiagnostics.CreateScope("ConnectedClusterStorageClassResource.Update"); scope.Start(); try { - var response = _storageClassResourceStorageClassRestClient.Update(Id.Parent, Id.Name, patch, cancellationToken); - var operation = new ContainerOrchestratorRuntimeArmOperation(new StorageClassResourceOperationSource(Client), _storageClassResourceStorageClassClientDiagnostics, Pipeline, _storageClassResourceStorageClassRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _connectedClusterStorageClassStorageClassRestClient.Update(Id.Parent, Id.Name, patch, cancellationToken); + var operation = new ContainerOrchestratorRuntimeArmOperation(new ConnectedClusterStorageClassOperationSource(Client), _connectedClusterStorageClassStorageClassClientDiagnostics, Pipeline, _connectedClusterStorageClassStorageClassRestClient.CreateUpdateRequest(Id.Parent, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs index cc217efe8192b..d969588783a11 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs @@ -22,21 +22,21 @@ private static MockableContainerOrchestratorRuntimeArmClient GetMockableContaine } /// - /// Gets a collection of BgpPeerResources in the ArmClient. + /// Gets a collection of ConnectedClusterBgpPeerResources in the ArmClient. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// is null. - /// An object representing collection of BgpPeerResources and their operations over a BgpPeerResource. - public static BgpPeerCollection GetBgpPeers(this ArmClient client, ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterBgpPeerResources and their operations over a ConnectedClusterBgpPeerResource. + public static ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(this ArmClient client, ResourceIdentifier scope) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetBgpPeers(scope); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeers(scope); } /// @@ -56,12 +56,12 @@ public static BgpPeerCollection GetBgpPeers(this ArmClient client, ResourceIdent /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -71,11 +71,11 @@ public static BgpPeerCollection GetBgpPeers(this ArmClient client, ResourceIdent /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetBgpPeerAsync(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + public static async Task> GetConnectedClusterBgpPeerAsync(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetBgpPeerAsync(scope, bgpPeerName, cancellationToken).ConfigureAwait(false); + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeerAsync(scope, bgpPeerName, cancellationToken).ConfigureAwait(false); } /// @@ -95,12 +95,12 @@ public static async Task> GetBgpPeerAsync(this ArmClie /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -110,29 +110,29 @@ public static async Task> GetBgpPeerAsync(this ArmClie /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetBgpPeer(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + public static Response GetConnectedClusterBgpPeer(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetBgpPeer(scope, bgpPeerName, cancellationToken); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeer(scope, bgpPeerName, cancellationToken); } /// - /// Gets a collection of LoadBalancerResources in the ArmClient. + /// Gets a collection of ConnectedClusterLoadBalancerResources in the ArmClient. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// is null. - /// An object representing collection of LoadBalancerResources and their operations over a LoadBalancerResource. - public static LoadBalancerCollection GetLoadBalancers(this ArmClient client, ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterLoadBalancerResources and their operations over a ConnectedClusterLoadBalancerResource. + public static ConnectedClusterLoadBalancerCollection GetConnectedClusterLoadBalancers(this ArmClient client, ResourceIdentifier scope) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetLoadBalancers(scope); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterLoadBalancers(scope); } /// @@ -152,12 +152,12 @@ public static LoadBalancerCollection GetLoadBalancers(this ArmClient client, Res /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -167,11 +167,11 @@ public static LoadBalancerCollection GetLoadBalancers(this ArmClient client, Res /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetLoadBalancerAsync(this ArmClient client, ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) + public static async Task> GetConnectedClusterLoadBalancerAsync(this ArmClient client, ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetLoadBalancerAsync(scope, loadBalancerName, cancellationToken).ConfigureAwait(false); + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterLoadBalancerAsync(scope, loadBalancerName, cancellationToken).ConfigureAwait(false); } /// @@ -191,12 +191,12 @@ public static async Task> GetLoadBalancerAsync(th /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -206,29 +206,29 @@ public static async Task> GetLoadBalancerAsync(th /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetLoadBalancer(this ArmClient client, ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) + public static Response GetConnectedClusterLoadBalancer(this ArmClient client, ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetLoadBalancer(scope, loadBalancerName, cancellationToken); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterLoadBalancer(scope, loadBalancerName, cancellationToken); } /// - /// Gets a collection of ServiceResources in the ArmClient. + /// Gets a collection of ConnectedClusterServiceResources in the ArmClient. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// is null. - /// An object representing collection of ServiceResources and their operations over a ServiceResource. - public static ServiceResourceCollection GetServiceResources(this ArmClient client, ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterServiceResources and their operations over a ConnectedClusterServiceResource. + public static ConnectedClusterServiceCollection GetConnectedClusterServices(this ArmClient client, ResourceIdentifier scope) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetServiceResources(scope); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterServices(scope); } /// @@ -248,12 +248,12 @@ public static ServiceResourceCollection GetServiceResources(this ArmClient clien /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -263,11 +263,11 @@ public static ServiceResourceCollection GetServiceResources(this ArmClient clien /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetServiceResourceAsync(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + public static async Task> GetConnectedClusterServiceAsync(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetServiceResourceAsync(scope, serviceName, cancellationToken).ConfigureAwait(false); + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterServiceAsync(scope, serviceName, cancellationToken).ConfigureAwait(false); } /// @@ -287,12 +287,12 @@ public static async Task> GetServiceResourceAsync(this /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -302,29 +302,29 @@ public static async Task> GetServiceResourceAsync(this /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetServiceResource(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + public static Response GetConnectedClusterService(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetServiceResource(scope, serviceName, cancellationToken); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterService(scope, serviceName, cancellationToken); } /// - /// Gets a collection of StorageClassResources in the ArmClient. + /// Gets a collection of ConnectedClusterStorageClassResources in the ArmClient. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// is null. - /// An object representing collection of StorageClassResources and their operations over a StorageClassResource. - public static StorageClassResourceCollection GetStorageClassResources(this ArmClient client, ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterStorageClassResources and their operations over a ConnectedClusterStorageClassResource. + public static ConnectedClusterStorageClassCollection GetConnectedClusterStorageClasses(this ArmClient client, ResourceIdentifier scope) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetStorageClassResources(scope); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClasses(scope); } /// @@ -344,12 +344,12 @@ public static StorageClassResourceCollection GetStorageClassResources(this ArmCl /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -359,11 +359,11 @@ public static StorageClassResourceCollection GetStorageClassResources(this ArmCl /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetStorageClassResourceAsync(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + public static async Task> GetConnectedClusterStorageClassAsync(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetStorageClassResourceAsync(scope, storageClassName, cancellationToken).ConfigureAwait(false); + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClassAsync(scope, storageClassName, cancellationToken).ConfigureAwait(false); } /// @@ -383,12 +383,12 @@ public static async Task> GetStorageClassResource /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -398,87 +398,87 @@ public static async Task> GetStorageClassResource /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetStorageClassResource(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + public static Response GetConnectedClusterStorageClass(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetStorageClassResource(scope, storageClassName, cancellationToken); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClass(scope, storageClassName, cancellationToken); } /// - /// 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 BgpPeerResource GetBgpPeerResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ConnectedClusterBgpPeerResource GetConnectedClusterBgpPeerResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetBgpPeerResource(id); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeerResource(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 LoadBalancerResource GetLoadBalancerResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ConnectedClusterLoadBalancerResource GetConnectedClusterLoadBalancerResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetLoadBalancerResource(id); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterLoadBalancerResource(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 ServiceResource GetServiceResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ConnectedClusterServiceResource GetConnectedClusterServiceResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetServiceResource(id); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterServiceResource(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 StorageClassResource GetStorageClassResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ConnectedClusterStorageClassResource GetConnectedClusterStorageClassResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetStorageClassResource(id); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClassResource(id); } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs index 6fc7e67dc3235..9cb2faade472d 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs @@ -37,12 +37,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of BgpPeerResources in the ArmClient. + /// Gets a collection of ConnectedClusterBgpPeerResources in the ArmClient. /// The scope that the resource will apply against. - /// An object representing collection of BgpPeerResources and their operations over a BgpPeerResource. - public virtual BgpPeerCollection GetBgpPeers(ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterBgpPeerResources and their operations over a ConnectedClusterBgpPeerResource. + public virtual ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(ResourceIdentifier scope) { - return new BgpPeerCollection(Client, scope); + return new ConnectedClusterBgpPeerCollection(Client, scope); } /// @@ -62,7 +62,7 @@ public virtual BgpPeerCollection GetBgpPeers(ResourceIdentifier scope) /// /// /// Resource - /// + /// /// /// /// @@ -72,9 +72,9 @@ public virtual BgpPeerCollection GetBgpPeers(ResourceIdentifier scope) /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetBgpPeerAsync(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + public virtual async Task> GetConnectedClusterBgpPeerAsync(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) { - return await GetBgpPeers(scope).GetAsync(bgpPeerName, cancellationToken).ConfigureAwait(false); + return await GetConnectedClusterBgpPeers(scope).GetAsync(bgpPeerName, cancellationToken).ConfigureAwait(false); } /// @@ -94,7 +94,7 @@ public virtual async Task> GetBgpPeerAsync(ResourceIde /// /// /// Resource - /// + /// /// /// /// @@ -104,17 +104,17 @@ public virtual async Task> GetBgpPeerAsync(ResourceIde /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetBgpPeer(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + public virtual Response GetConnectedClusterBgpPeer(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) { - return GetBgpPeers(scope).Get(bgpPeerName, cancellationToken); + return GetConnectedClusterBgpPeers(scope).Get(bgpPeerName, cancellationToken); } - /// Gets a collection of LoadBalancerResources in the ArmClient. + /// Gets a collection of ConnectedClusterLoadBalancerResources in the ArmClient. /// The scope that the resource will apply against. - /// An object representing collection of LoadBalancerResources and their operations over a LoadBalancerResource. - public virtual LoadBalancerCollection GetLoadBalancers(ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterLoadBalancerResources and their operations over a ConnectedClusterLoadBalancerResource. + public virtual ConnectedClusterLoadBalancerCollection GetConnectedClusterLoadBalancers(ResourceIdentifier scope) { - return new LoadBalancerCollection(Client, scope); + return new ConnectedClusterLoadBalancerCollection(Client, scope); } /// @@ -134,7 +134,7 @@ public virtual LoadBalancerCollection GetLoadBalancers(ResourceIdentifier scope) /// /// /// Resource - /// + /// /// /// /// @@ -144,9 +144,9 @@ public virtual LoadBalancerCollection GetLoadBalancers(ResourceIdentifier scope) /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetLoadBalancerAsync(ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) + public virtual async Task> GetConnectedClusterLoadBalancerAsync(ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) { - return await GetLoadBalancers(scope).GetAsync(loadBalancerName, cancellationToken).ConfigureAwait(false); + return await GetConnectedClusterLoadBalancers(scope).GetAsync(loadBalancerName, cancellationToken).ConfigureAwait(false); } /// @@ -166,7 +166,7 @@ public virtual async Task> GetLoadBalancerAsync(R /// /// /// Resource - /// + /// /// /// /// @@ -176,17 +176,17 @@ public virtual async Task> GetLoadBalancerAsync(R /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetLoadBalancer(ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) + public virtual Response GetConnectedClusterLoadBalancer(ResourceIdentifier scope, string loadBalancerName, CancellationToken cancellationToken = default) { - return GetLoadBalancers(scope).Get(loadBalancerName, cancellationToken); + return GetConnectedClusterLoadBalancers(scope).Get(loadBalancerName, cancellationToken); } - /// Gets a collection of ServiceResources in the ArmClient. + /// Gets a collection of ConnectedClusterServiceResources in the ArmClient. /// The scope that the resource will apply against. - /// An object representing collection of ServiceResources and their operations over a ServiceResource. - public virtual ServiceResourceCollection GetServiceResources(ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterServiceResources and their operations over a ConnectedClusterServiceResource. + public virtual ConnectedClusterServiceCollection GetConnectedClusterServices(ResourceIdentifier scope) { - return new ServiceResourceCollection(Client, scope); + return new ConnectedClusterServiceCollection(Client, scope); } /// @@ -206,7 +206,7 @@ public virtual ServiceResourceCollection GetServiceResources(ResourceIdentifier /// /// /// Resource - /// + /// /// /// /// @@ -216,9 +216,9 @@ public virtual ServiceResourceCollection GetServiceResources(ResourceIdentifier /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetServiceResourceAsync(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetConnectedClusterServiceAsync(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) { - return await GetServiceResources(scope).GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + return await GetConnectedClusterServices(scope).GetAsync(serviceName, cancellationToken).ConfigureAwait(false); } /// @@ -238,7 +238,7 @@ public virtual async Task> GetServiceResourceAsync(Res /// /// /// Resource - /// + /// /// /// /// @@ -248,17 +248,17 @@ public virtual async Task> GetServiceResourceAsync(Res /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetServiceResource(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + public virtual Response GetConnectedClusterService(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) { - return GetServiceResources(scope).Get(serviceName, cancellationToken); + return GetConnectedClusterServices(scope).Get(serviceName, cancellationToken); } - /// Gets a collection of StorageClassResources in the ArmClient. + /// Gets a collection of ConnectedClusterStorageClassResources in the ArmClient. /// The scope that the resource will apply against. - /// An object representing collection of StorageClassResources and their operations over a StorageClassResource. - public virtual StorageClassResourceCollection GetStorageClassResources(ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterStorageClassResources and their operations over a ConnectedClusterStorageClassResource. + public virtual ConnectedClusterStorageClassCollection GetConnectedClusterStorageClasses(ResourceIdentifier scope) { - return new StorageClassResourceCollection(Client, scope); + return new ConnectedClusterStorageClassCollection(Client, scope); } /// @@ -278,7 +278,7 @@ public virtual StorageClassResourceCollection GetStorageClassResources(ResourceI /// /// /// Resource - /// + /// /// /// /// @@ -288,9 +288,9 @@ public virtual StorageClassResourceCollection GetStorageClassResources(ResourceI /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetStorageClassResourceAsync(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + public virtual async Task> GetConnectedClusterStorageClassAsync(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) { - return await GetStorageClassResources(scope).GetAsync(storageClassName, cancellationToken).ConfigureAwait(false); + return await GetConnectedClusterStorageClasses(scope).GetAsync(storageClassName, cancellationToken).ConfigureAwait(false); } /// @@ -310,7 +310,7 @@ public virtual async Task> GetStorageClassResourc /// /// /// Resource - /// + /// /// /// /// @@ -320,57 +320,57 @@ public virtual async Task> GetStorageClassResourc /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetStorageClassResource(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + public virtual Response GetConnectedClusterStorageClass(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) { - return GetStorageClassResources(scope).Get(storageClassName, cancellationToken); + return GetConnectedClusterStorageClasses(scope).Get(storageClassName, cancellationToken); } /// - /// 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 BgpPeerResource GetBgpPeerResource(ResourceIdentifier id) + /// Returns a object. + public virtual ConnectedClusterBgpPeerResource GetConnectedClusterBgpPeerResource(ResourceIdentifier id) { - BgpPeerResource.ValidateResourceId(id); - return new BgpPeerResource(Client, id); + ConnectedClusterBgpPeerResource.ValidateResourceId(id); + return new ConnectedClusterBgpPeerResource(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 LoadBalancerResource GetLoadBalancerResource(ResourceIdentifier id) + /// Returns a object. + public virtual ConnectedClusterLoadBalancerResource GetConnectedClusterLoadBalancerResource(ResourceIdentifier id) { - LoadBalancerResource.ValidateResourceId(id); - return new LoadBalancerResource(Client, id); + ConnectedClusterLoadBalancerResource.ValidateResourceId(id); + return new ConnectedClusterLoadBalancerResource(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 ServiceResource GetServiceResource(ResourceIdentifier id) + /// Returns a object. + public virtual ConnectedClusterServiceResource GetConnectedClusterServiceResource(ResourceIdentifier id) { - ServiceResource.ValidateResourceId(id); - return new ServiceResource(Client, id); + ConnectedClusterServiceResource.ValidateResourceId(id); + return new ConnectedClusterServiceResource(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 StorageClassResource GetStorageClassResource(ResourceIdentifier id) + /// Returns a object. + public virtual ConnectedClusterStorageClassResource GetConnectedClusterStorageClassResource(ResourceIdentifier id) { - StorageClassResource.ValidateResourceId(id); - return new StorageClassResource(Client, id); + ConnectedClusterStorageClassResource.ValidateResourceId(id); + return new ConnectedClusterStorageClassResource(Client, id); } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.Serialization.cs deleted file mode 100644 index f1ac936c92484..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LoadBalancerResource.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.ContainerOrchestratorRuntime -{ - public partial class LoadBalancerResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - LoadBalancerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - LoadBalancerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/BgpPeerOperationSource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/BgpPeerOperationSource.cs deleted file mode 100644 index dbb06263d6c00..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/BgpPeerOperationSource.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.ContainerOrchestratorRuntime -{ - internal class BgpPeerOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal BgpPeerOperationSource(ArmClient client) - { - _client = client; - } - - BgpPeerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = BgpPeerData.DeserializeBgpPeerData(document.RootElement); - return new BgpPeerResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = BgpPeerData.DeserializeBgpPeerData(document.RootElement); - return new BgpPeerResource(_client, data); - } - } -} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterBgpPeerOperationSource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterBgpPeerOperationSource.cs new file mode 100644 index 0000000000000..65ddf31da0737 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterBgpPeerOperationSource.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.ContainerOrchestratorRuntime +{ + internal class ConnectedClusterBgpPeerOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ConnectedClusterBgpPeerOperationSource(ArmClient client) + { + _client = client; + } + + ConnectedClusterBgpPeerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ConnectedClusterBgpPeerData.DeserializeConnectedClusterBgpPeerData(document.RootElement); + return new ConnectedClusterBgpPeerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ConnectedClusterBgpPeerData.DeserializeConnectedClusterBgpPeerData(document.RootElement); + return new ConnectedClusterBgpPeerResource(_client, data); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterLoadBalancerOperationSource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterLoadBalancerOperationSource.cs new file mode 100644 index 0000000000000..89cae47fe4b80 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterLoadBalancerOperationSource.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.ContainerOrchestratorRuntime +{ + internal class ConnectedClusterLoadBalancerOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ConnectedClusterLoadBalancerOperationSource(ArmClient client) + { + _client = client; + } + + ConnectedClusterLoadBalancerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ConnectedClusterLoadBalancerData.DeserializeConnectedClusterLoadBalancerData(document.RootElement); + return new ConnectedClusterLoadBalancerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ConnectedClusterLoadBalancerData.DeserializeConnectedClusterLoadBalancerData(document.RootElement); + return new ConnectedClusterLoadBalancerResource(_client, data); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterStorageClassOperationSource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterStorageClassOperationSource.cs new file mode 100644 index 0000000000000..8c5e947734831 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/ConnectedClusterStorageClassOperationSource.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.ContainerOrchestratorRuntime +{ + internal class ConnectedClusterStorageClassOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ConnectedClusterStorageClassOperationSource(ArmClient client) + { + _client = client; + } + + ConnectedClusterStorageClassResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ConnectedClusterStorageClassData.DeserializeConnectedClusterStorageClassData(document.RootElement); + return new ConnectedClusterStorageClassResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ConnectedClusterStorageClassData.DeserializeConnectedClusterStorageClassData(document.RootElement); + return new ConnectedClusterStorageClassResource(_client, data); + } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/LoadBalancerOperationSource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/LoadBalancerOperationSource.cs deleted file mode 100644 index eb96c1ac7e675..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/LoadBalancerOperationSource.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.ContainerOrchestratorRuntime -{ - internal class LoadBalancerOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal LoadBalancerOperationSource(ArmClient client) - { - _client = client; - } - - LoadBalancerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = LoadBalancerData.DeserializeLoadBalancerData(document.RootElement); - return new LoadBalancerResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = LoadBalancerData.DeserializeLoadBalancerData(document.RootElement); - return new LoadBalancerResource(_client, data); - } - } -} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/StorageClassResourceOperationSource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/StorageClassResourceOperationSource.cs deleted file mode 100644 index af1496880b3b1..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/LongRunningOperation/StorageClassResourceOperationSource.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.ContainerOrchestratorRuntime -{ - internal class StorageClassResourceOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal StorageClassResourceOperationSource(ArmClient client) - { - _client = client; - } - - StorageClassResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = StorageClassResourceData.DeserializeStorageClassResourceData(document.RootElement); - return new StorageClassResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = StorageClassResourceData.DeserializeStorageClassResourceData(document.RootElement); - return new StorageClassResource(_client, data); - } - } -} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs index ad37756bc9354..62e8d697050da 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs @@ -22,14 +22,14 @@ public AdvertiseMode(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string ARPValue = "ARP"; - private const string BGPValue = "BGP"; + private const string ArpValue = "ARP"; + private const string BgpValue = "BGP"; private const string BothValue = "Both"; /// ARP advertise mode. - public static AdvertiseMode ARP { get; } = new AdvertiseMode(ARPValue); + public static AdvertiseMode Arp { get; } = new AdvertiseMode(ArpValue); /// BGP advertise mode. - public static AdvertiseMode BGP { get; } = new AdvertiseMode(BGPValue); + public static AdvertiseMode Bgp { get; } = new AdvertiseMode(BgpValue); /// both ARP and BGP advertise mode. public static AdvertiseMode Both { get; } = new AdvertiseMode(BothValue); /// Determines if two values are the same. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.Serialization.cs index 9186702afe924..61463c25325d2 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class BgpPeerListResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(BgpPeerListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } BgpPeerListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -76,7 +83,7 @@ internal static BgpPeerListResult DeserializeBgpPeerListResult(JsonElement eleme { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -84,10 +91,10 @@ internal static BgpPeerListResult DeserializeBgpPeerListResult(JsonElement eleme { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(BgpPeerData.DeserializeBgpPeerData(item, options)); + array.Add(ConnectedClusterBgpPeerData.DeserializeConnectedClusterBgpPeerData(item, options)); } value = array; continue; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.cs index 2f11c58563839..78a37cd6a785c 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BgpPeerListResult.cs @@ -49,7 +49,7 @@ internal partial class BgpPeerListResult /// Initializes a new instance of . /// The BgpPeer items on this page. /// is null. - internal BgpPeerListResult(IEnumerable value) + internal BgpPeerListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal BgpPeerListResult(IEnumerable value) /// The BgpPeer items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal BgpPeerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal BgpPeerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal BgpPeerListResult() } /// The BgpPeer items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.Serialization.cs index 9f1eaebe61216..063c0867546f8 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class BlobStorageClassTypeProperties : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,29 +34,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(BlobStorageClassTypeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("azureStorageAccountName"u8); writer.WriteStringValue(AzureStorageAccountName); writer.WritePropertyName("azureStorageAccountKey"u8); writer.WriteStringValue(AzureStorageAccountKey); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(SCType.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(); } BlobStorageClassTypeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -72,7 +63,7 @@ internal static BlobStorageClassTypeProperties DeserializeBlobStorageClassTypePr } string azureStorageAccountName = default; string azureStorageAccountKey = default; - SCType type = default; + StorageClassType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -89,7 +80,7 @@ internal static BlobStorageClassTypeProperties DeserializeBlobStorageClassTypePr } if (property.NameEquals("type"u8)) { - type = new SCType(property.Value.GetString()); + type = new StorageClassType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs index 831f96f09bc5e..306f663ced624 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs @@ -24,19 +24,19 @@ public BlobStorageClassTypeProperties(string azureStorageAccountName, string azu AzureStorageAccountName = azureStorageAccountName; AzureStorageAccountKey = azureStorageAccountKey; - SCType = SCType.Blob; + ClassType = StorageClassType.Blob; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. /// Azure Storage Account Name. /// Azure Storage Account Key. - internal BlobStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData, string azureStorageAccountName, string azureStorageAccountKey) : base(scType, serializedAdditionalRawData) + internal BlobStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData, string azureStorageAccountName, string azureStorageAccountKey) : base(classType, serializedAdditionalRawData) { AzureStorageAccountName = azureStorageAccountName; AzureStorageAccountKey = azureStorageAccountKey; - SCType = scType; + ClassType = classType; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassPatch.Serialization.cs similarity index 57% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.Serialization.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassPatch.Serialization.cs index 68b0af7b40212..71da6ee5f3d47 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassPatch.Serialization.cs @@ -13,19 +13,27 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models { - public partial class StorageClassResourcePatch : IUtf8JsonSerializable, IJsonModel + public partial class ConnectedClusterStorageClassPatch : 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; + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(StorageClassResourcePatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -46,22 +54,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } - StorageClassResourcePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ConnectedClusterStorageClassPatch 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(StorageClassResourcePatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassPatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageClassResourcePatch(document.RootElement, options); + return DeserializeConnectedClusterStorageClassPatch(document.RootElement, options); } - internal static StorageClassResourcePatch DeserializeStorageClassResourcePatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static ConnectedClusterStorageClassPatch DeserializeConnectedClusterStorageClassPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,38 +96,38 @@ internal static StorageClassResourcePatch DeserializeStorageClassResourcePatch(J } } serializedAdditionalRawData = rawDataDictionary; - return new StorageClassResourcePatch(properties, serializedAdditionalRawData); + return new ConnectedClusterStorageClassPatch(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(StorageClassResourcePatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassPatch)} does not support writing '{options.Format}' format."); } } - StorageClassResourcePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ConnectedClusterStorageClassPatch 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 DeserializeStorageClassResourcePatch(document.RootElement, options); + return DeserializeConnectedClusterStorageClassPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(StorageClassResourcePatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassPatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassPatch.cs similarity index 81% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.cs rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassPatch.cs index 643fab998c6d2..fb05d9cbd2037 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourcePatch.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassPatch.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models { /// The model for updating a storageClass. - public partial class StorageClassResourcePatch + public partial class ConnectedClusterStorageClassPatch { /// /// Keeps track of any properties unknown to the library. @@ -45,15 +45,15 @@ public partial class StorageClassResourcePatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public StorageClassResourcePatch() + /// Initializes a new instance of . + public ConnectedClusterStorageClassPatch() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The properties of StorageClass. /// Keeps track of any properties unknown to the library. - internal StorageClassResourcePatch(StorageClassPropertiesUpdate properties, IDictionary serializedAdditionalRawData) + internal ConnectedClusterStorageClassPatch(StorageClassPropertiesUpdate properties, IDictionary serializedAdditionalRawData) { Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.Serialization.cs index 773df54ed9c90..7c24e3ae20661 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class LoadBalancerListResult : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(LoadBalancerListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } LoadBalancerListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -76,7 +83,7 @@ internal static LoadBalancerListResult DeserializeLoadBalancerListResult(JsonEle { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -84,10 +91,10 @@ internal static LoadBalancerListResult DeserializeLoadBalancerListResult(JsonEle { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(LoadBalancerData.DeserializeLoadBalancerData(item, options)); + array.Add(ConnectedClusterLoadBalancerData.DeserializeConnectedClusterLoadBalancerData(item, options)); } value = array; continue; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.cs index 3e41cfd9b6172..57c5985deef75 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/LoadBalancerListResult.cs @@ -49,7 +49,7 @@ internal partial class LoadBalancerListResult /// Initializes a new instance of . /// The LoadBalancer items on this page. /// is null. - internal LoadBalancerListResult(IEnumerable value) + internal LoadBalancerListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal LoadBalancerListResult(IEnumerable value) /// The LoadBalancer items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal LoadBalancerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal LoadBalancerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal LoadBalancerListResult() } /// The LoadBalancer items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.Serialization.cs index 3b6c69a037232..67cfac9d571bb 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class NativeStorageClassTypeProperties : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(NativeStorageClassTypeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(SCType.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(); + base.JsonModelWriteCore(writer, options); } NativeStorageClassTypeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -66,14 +57,14 @@ internal static NativeStorageClassTypeProperties DeserializeNativeStorageClassTy { return null; } - SCType type = default; + StorageClassType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("type"u8)) { - type = new SCType(property.Value.GetString()); + type = new StorageClassType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs index ec26a62ec04a0..82fc04b037495 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs @@ -16,15 +16,15 @@ public partial class NativeStorageClassTypeProperties : StorageClassTypeProperti /// Initializes a new instance of . public NativeStorageClassTypeProperties() { - SCType = SCType.Native; + ClassType = StorageClassType.Native; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. - internal NativeStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData) : base(scType, serializedAdditionalRawData) + internal NativeStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData) : base(classType, serializedAdditionalRawData) { - SCType = scType; + ClassType = classType; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.Serialization.cs index fd7353ab55ebe..084d515f71fa2 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class NfsStorageClassTypeProperties : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(NfsStorageClassTypeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("server"u8); writer.WriteStringValue(Server); writer.WritePropertyName("share"u8); @@ -45,24 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("onDelete"u8); writer.WriteStringValue(OnDelete.Value.ToString()); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(SCType.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(); } NfsStorageClassTypeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -90,7 +81,7 @@ internal static NfsStorageClassTypeProperties DeserializeNfsStorageClassTypeProp string subDir = default; string mountPermissions = default; NfsDirectoryActionOnVolumeDeletion? onDelete = default; - SCType type = default; + StorageClassType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -126,7 +117,7 @@ internal static NfsStorageClassTypeProperties DeserializeNfsStorageClassTypeProp } if (property.NameEquals("type"u8)) { - type = new SCType(property.Value.GetString()); + type = new StorageClassType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs index e6de7b13d45d5..7dc006549d85a 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs @@ -24,25 +24,25 @@ public NfsStorageClassTypeProperties(string server, string share) Server = server; Share = share; - SCType = SCType.NFS; + ClassType = StorageClassType.Nfs; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. /// NFS Server. /// NFS share. /// Sub directory under share. If the sub directory doesn't exist, driver will create it. /// Mounted folder permissions. Default is 0. If set as non-zero, driver will perform `chmod` after mount. /// The action to take when a NFS volume is deleted. Default is Delete. - internal NfsStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData, string server, string share, string subDir, string mountPermissions, NfsDirectoryActionOnVolumeDeletion? onDelete) : base(scType, serializedAdditionalRawData) + internal NfsStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData, string server, string share, string subDir, string mountPermissions, NfsDirectoryActionOnVolumeDeletion? onDelete) : base(classType, serializedAdditionalRawData) { Server = server; Share = share; SubDir = subDir; MountPermissions = mountPermissions; OnDelete = onDelete; - SCType = scType; + ClassType = classType; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.Serialization.cs index 73fd70b4d4da7..d4dc04ffd042b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class RwxStorageClassTypeProperties : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,27 +34,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(RwxStorageClassTypeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("backingStorageClassName"u8); writer.WriteStringValue(BackingStorageClassName); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(SCType.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(); } RwxStorageClassTypeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -69,7 +60,7 @@ internal static RwxStorageClassTypeProperties DeserializeRwxStorageClassTypeProp return null; } string backingStorageClassName = default; - SCType type = default; + StorageClassType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -81,7 +72,7 @@ internal static RwxStorageClassTypeProperties DeserializeRwxStorageClassTypeProp } if (property.NameEquals("type"u8)) { - type = new SCType(property.Value.GetString()); + type = new StorageClassType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs index d2430d8e15466..52b421398f2b1 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs @@ -21,17 +21,17 @@ public RwxStorageClassTypeProperties(string backingStorageClassName) Argument.AssertNotNull(backingStorageClassName, nameof(backingStorageClassName)); BackingStorageClassName = backingStorageClassName; - SCType = SCType.RWX; + ClassType = StorageClassType.Rwx; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. /// The backing storageclass used to create new storageclass. - internal RwxStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData, string backingStorageClassName) : base(scType, serializedAdditionalRawData) + internal RwxStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData, string backingStorageClassName) : base(classType, serializedAdditionalRawData) { BackingStorageClassName = backingStorageClassName; - SCType = scType; + ClassType = classType; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SCType.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SCType.cs deleted file mode 100644 index b41c8270f6cf8..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SCType.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.ContainerOrchestratorRuntime.Models -{ - /// Type of a storage class. - internal readonly partial struct SCType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SCType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NativeValue = "Native"; - private const string RWXValue = "RWX"; - private const string BlobValue = "Blob"; - private const string NFSValue = "NFS"; - private const string SMBValue = "SMB"; - - /// Native storage class. - public static SCType Native { get; } = new SCType(NativeValue); - /// RWX storage class. - public static SCType RWX { get; } = new SCType(RWXValue); - /// Blob storage class. - public static SCType Blob { get; } = new SCType(BlobValue); - /// NFS storage class. - public static SCType NFS { get; } = new SCType(NFSValue); - /// SMB storage class. - public static SCType SMB { get; } = new SCType(SMBValue); - /// Determines if two values are the same. - public static bool operator ==(SCType left, SCType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SCType left, SCType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SCType(string value) => new SCType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SCType other && Equals(other); - /// - public bool Equals(SCType 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.Serialization.cs index a92fd962ff6ec..e3fb2428249cc 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ServiceResourceListResult : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ServiceResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ServiceResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -76,7 +83,7 @@ internal static ServiceResourceListResult DeserializeServiceResourceListResult(J { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -84,10 +91,10 @@ internal static ServiceResourceListResult DeserializeServiceResourceListResult(J { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ServiceResourceData.DeserializeServiceResourceData(item, options)); + array.Add(ConnectedClusterServiceData.DeserializeConnectedClusterServiceData(item, options)); } value = array; continue; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.cs index b9b27d103daf8..76bf3d695cb9b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ServiceResourceListResult.cs @@ -49,7 +49,7 @@ internal partial class ServiceResourceListResult /// Initializes a new instance of . /// The ServiceResource items on this page. /// is null. - internal ServiceResourceListResult(IEnumerable value) + internal ServiceResourceListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal ServiceResourceListResult(IEnumerable value) /// The ServiceResource items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ServiceResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal ServiceResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal ServiceResourceListResult() } /// The ServiceResource items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.Serialization.cs index bb21a65a1e80b..876ea63971919 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class SmbStorageClassTypeProperties : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(SmbStorageClassTypeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("source"u8); writer.WriteStringValue(Source); if (Optional.IsDefined(SubDir)) @@ -48,24 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("domain"u8); writer.WriteStringValue(Domain); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(SCType.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(); } SmbStorageClassTypeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -93,7 +84,7 @@ internal static SmbStorageClassTypeProperties DeserializeSmbStorageClassTypeProp string username = default; string password = default; string domain = default; - SCType type = default; + StorageClassType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -125,7 +116,7 @@ internal static SmbStorageClassTypeProperties DeserializeSmbStorageClassTypeProp } if (property.NameEquals("type"u8)) { - type = new SCType(property.Value.GetString()); + type = new StorageClassType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs index 89ae87aeb971c..72c0f8686e227 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs @@ -21,25 +21,25 @@ public SmbStorageClassTypeProperties(string source) Argument.AssertNotNull(source, nameof(source)); Source = source; - SCType = SCType.SMB; + ClassType = StorageClassType.Smb; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. /// SMB Source. /// Sub directory under share. If the sub directory doesn't exist, driver will create it. /// Server username. /// Server password. /// Server domain. - internal SmbStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData, string source, string subDir, string username, string password, string domain) : base(scType, serializedAdditionalRawData) + internal SmbStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData, string source, string subDir, string username, string password, string domain) : base(classType, serializedAdditionalRawData) { Source = source; SubDir = subDir; Username = username; Password = password; Domain = domain; - SCType = scType; + ClassType = classType; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs index a474a95439176..c612c0c1aa791 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassPropertiesUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class StorageClassPropertiesUpdate : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(StorageClassPropertiesUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(AllowVolumeExpansion)) { writer.WritePropertyName("allowVolumeExpansion"u8); @@ -101,7 +109,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } StorageClassPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.Serialization.cs index 4239bb17d9356..0a06507b9e203 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class StorageClassResourceListResult : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(StorageClassResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("value"u8); writer.WriteStartArray(); foreach (var item in Value) @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } StorageClassResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -76,7 +83,7 @@ internal static StorageClassResourceListResult DeserializeStorageClassResourceLi { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -84,10 +91,10 @@ internal static StorageClassResourceListResult DeserializeStorageClassResourceLi { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(StorageClassResourceData.DeserializeStorageClassResourceData(item, options)); + array.Add(ConnectedClusterStorageClassData.DeserializeConnectedClusterStorageClassData(item, options)); } value = array; continue; diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.cs index d9a5c74a8ed5c..3b009ba86c997 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassResourceListResult.cs @@ -49,7 +49,7 @@ internal partial class StorageClassResourceListResult /// Initializes a new instance of . /// The StorageClassResource items on this page. /// is null. - internal StorageClassResourceListResult(IEnumerable value) + internal StorageClassResourceListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal StorageClassResourceListResult(IEnumerable va /// The StorageClassResource items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal StorageClassResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal StorageClassResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal StorageClassResourceListResult() } /// The StorageClassResource items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassType.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassType.cs new file mode 100644 index 0000000000000..64c104fa028f5 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassType.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.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// Type of a storage class. + internal readonly partial struct StorageClassType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageClassType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NativeValue = "Native"; + private const string RwxValue = "RWX"; + private const string BlobValue = "Blob"; + private const string NfsValue = "NFS"; + private const string SmbValue = "SMB"; + + /// Native storage class. + public static StorageClassType Native { get; } = new StorageClassType(NativeValue); + /// RWX storage class. + public static StorageClassType Rwx { get; } = new StorageClassType(RwxValue); + /// Blob storage class. + public static StorageClassType Blob { get; } = new StorageClassType(BlobValue); + /// NFS storage class. + public static StorageClassType Nfs { get; } = new StorageClassType(NfsValue); + /// SMB storage class. + public static StorageClassType Smb { get; } = new StorageClassType(SmbValue); + /// Determines if two values are the same. + public static bool operator ==(StorageClassType left, StorageClassType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageClassType left, StorageClassType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StorageClassType(string value) => new StorageClassType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StorageClassType other && Equals(other); + /// + public bool Equals(StorageClassType 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/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs index 07b29695aff07..5796ea74b0383 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class StorageClassTypeProperties : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,9 +34,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(StorageClassTypeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("type"u8); - writer.WriteStringValue(SCType.ToString()); + writer.WriteStringValue(ClassType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } StorageClassTypeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs index cfc21cf345f95..22ce4e2fd9f5b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs @@ -55,15 +55,15 @@ protected StorageClassTypeProperties() } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. - internal StorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData) + internal StorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData) { - SCType = scType; + ClassType = classType; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Type of the storage class. - internal SCType SCType { get; set; } + internal StorageClassType ClassType { get; set; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.Serialization.cs index 119efdefc850f..9e968b675a042 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypePropertiesUpdate.Serialization.cs @@ -18,6 +18,15 @@ public partial class StorageClassTypePropertiesUpdate : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(StorageClassTypePropertiesUpdate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(BackingStorageClassName)) { writer.WritePropertyName("backingStorageClassName"u8); @@ -101,7 +109,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } StorageClassTypePropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.Serialization.cs index f40e92f5dd231..7c6b92fe8ef50 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownStorageClassTypeProperties : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(StorageClassTypeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(SCType.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(); + base.JsonModelWriteCore(writer, options); } StorageClassTypeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -66,14 +57,14 @@ internal static UnknownStorageClassTypeProperties DeserializeUnknownStorageClass { return null; } - SCType type = "Unknown"; + StorageClassType type = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("type"u8)) { - type = new SCType(property.Value.GetString()); + type = new StorageClassType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs index 5274d90a3b2be..feb8756103ef5 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models internal partial class UnknownStorageClassTypeProperties : StorageClassTypeProperties { /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. - internal UnknownStorageClassTypeProperties(SCType scType, IDictionary serializedAdditionalRawData) : base(scType, serializedAdditionalRawData) + internal UnknownStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData) : base(classType, serializedAdditionalRawData) { - SCType = scType; + ClassType = classType; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs index 96dee5b5569ad..88867830f77ad 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs @@ -148,7 +148,7 @@ internal HttpMessage CreateGetRequest(string resourceUri, string bgpPeerName) /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceUri, string bgpPeerName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string resourceUri, string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); @@ -159,13 +159,13 @@ public async Task> GetAsync(string resourceUri, string bgp { case 200: { - BgpPeerData value = default; + ConnectedClusterBgpPeerData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BgpPeerData.DeserializeBgpPeerData(document.RootElement); + value = ConnectedClusterBgpPeerData.DeserializeConnectedClusterBgpPeerData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((BgpPeerData)null, message.Response); + return Response.FromValue((ConnectedClusterBgpPeerData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -177,7 +177,7 @@ public async Task> GetAsync(string resourceUri, string bgp /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceUri, string bgpPeerName, CancellationToken cancellationToken = default) + public Response Get(string resourceUri, string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); @@ -188,19 +188,19 @@ public Response Get(string resourceUri, string bgpPeerName, Cancell { case 200: { - BgpPeerData value = default; + ConnectedClusterBgpPeerData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BgpPeerData.DeserializeBgpPeerData(document.RootElement); + value = ConnectedClusterBgpPeerData.DeserializeConnectedClusterBgpPeerData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((BgpPeerData)null, message.Response); + return Response.FromValue((ConnectedClusterBgpPeerData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string bgpPeerName, BgpPeerData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string bgpPeerName, ConnectedClusterBgpPeerData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -212,7 +212,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, st return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string bgpPeerName, BgpPeerData data) + internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string bgpPeerName, ConnectedClusterBgpPeerData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -241,7 +241,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string bgpP /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string resourceUri, string bgpPeerName, BgpPeerData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string resourceUri, string bgpPeerName, ConnectedClusterBgpPeerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); @@ -266,7 +266,7 @@ public async Task CreateOrUpdateAsync(string resourceUri, string bgpPe /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string resourceUri, string bgpPeerName, BgpPeerData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string resourceUri, string bgpPeerName, ConnectedClusterBgpPeerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(bgpPeerName, nameof(bgpPeerName)); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs index 0ee2b418d8852..e9a4c221f7dc3 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs @@ -148,7 +148,7 @@ internal HttpMessage CreateGetRequest(string resourceUri, string loadBalancerNam /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceUri, string loadBalancerName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string resourceUri, string loadBalancerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); @@ -159,13 +159,13 @@ public async Task> GetAsync(string resourceUri, strin { case 200: { - LoadBalancerData value = default; + ConnectedClusterLoadBalancerData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LoadBalancerData.DeserializeLoadBalancerData(document.RootElement); + value = ConnectedClusterLoadBalancerData.DeserializeConnectedClusterLoadBalancerData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((LoadBalancerData)null, message.Response); + return Response.FromValue((ConnectedClusterLoadBalancerData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -177,7 +177,7 @@ public async Task> GetAsync(string resourceUri, strin /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceUri, string loadBalancerName, CancellationToken cancellationToken = default) + public Response Get(string resourceUri, string loadBalancerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); @@ -188,19 +188,19 @@ public Response Get(string resourceUri, string loadBalancerNam { case 200: { - LoadBalancerData value = default; + ConnectedClusterLoadBalancerData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LoadBalancerData.DeserializeLoadBalancerData(document.RootElement); + value = ConnectedClusterLoadBalancerData.DeserializeConnectedClusterLoadBalancerData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((LoadBalancerData)null, message.Response); + return Response.FromValue((ConnectedClusterLoadBalancerData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string loadBalancerName, LoadBalancerData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string loadBalancerName, ConnectedClusterLoadBalancerData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -212,7 +212,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, st return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string loadBalancerName, LoadBalancerData data) + internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string loadBalancerName, ConnectedClusterLoadBalancerData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -241,7 +241,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string load /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string resourceUri, string loadBalancerName, LoadBalancerData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string resourceUri, string loadBalancerName, ConnectedClusterLoadBalancerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); @@ -266,7 +266,7 @@ public async Task CreateOrUpdateAsync(string resourceUri, string loadB /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string resourceUri, string loadBalancerName, LoadBalancerData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string resourceUri, string loadBalancerName, ConnectedClusterLoadBalancerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs index f6cc742bcc302..e31a99556e874 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs @@ -148,7 +148,7 @@ internal HttpMessage CreateGetRequest(string resourceUri, string serviceName) /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceUri, string serviceName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string resourceUri, string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); @@ -159,13 +159,13 @@ public async Task> GetAsync(string resourceUri, st { case 200: { - ServiceResourceData value = default; + ConnectedClusterServiceData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ServiceResourceData.DeserializeServiceResourceData(document.RootElement); + value = ConnectedClusterServiceData.DeserializeConnectedClusterServiceData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ServiceResourceData)null, message.Response); + return Response.FromValue((ConnectedClusterServiceData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -177,7 +177,7 @@ public async Task> GetAsync(string resourceUri, st /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceUri, string serviceName, CancellationToken cancellationToken = default) + public Response Get(string resourceUri, string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); @@ -188,19 +188,19 @@ public Response Get(string resourceUri, string serviceName, { case 200: { - ServiceResourceData value = default; + ConnectedClusterServiceData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ServiceResourceData.DeserializeServiceResourceData(document.RootElement); + value = ConnectedClusterServiceData.DeserializeConnectedClusterServiceData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ServiceResourceData)null, message.Response); + return Response.FromValue((ConnectedClusterServiceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string serviceName, ServiceResourceData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string serviceName, ConnectedClusterServiceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -212,7 +212,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, st return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string serviceName, ServiceResourceData data) + internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string serviceName, ConnectedClusterServiceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -241,7 +241,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string serv /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string resourceUri, string serviceName, ServiceResourceData data, CancellationToken cancellationToken = default) + public async Task> CreateOrUpdateAsync(string resourceUri, string serviceName, ConnectedClusterServiceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); @@ -254,9 +254,9 @@ public async Task> CreateOrUpdateAsync(string reso case 200: case 201: { - ServiceResourceData value = default; + ConnectedClusterServiceData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ServiceResourceData.DeserializeServiceResourceData(document.RootElement); + value = ConnectedClusterServiceData.DeserializeConnectedClusterServiceData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -271,7 +271,7 @@ public async Task> CreateOrUpdateAsync(string reso /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string resourceUri, string serviceName, ServiceResourceData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string resourceUri, string serviceName, ConnectedClusterServiceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName)); @@ -284,9 +284,9 @@ public Response CreateOrUpdate(string resourceUri, string s case 200: case 201: { - ServiceResourceData value = default; + ConnectedClusterServiceData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ServiceResourceData.DeserializeServiceResourceData(document.RootElement); + value = ConnectedClusterServiceData.DeserializeConnectedClusterServiceData(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs index c6153c6adf909..472d8a4ec71bb 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs @@ -148,7 +148,7 @@ internal HttpMessage CreateGetRequest(string resourceUri, string storageClassNam /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceUri, string storageClassName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string resourceUri, string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); @@ -159,13 +159,13 @@ public async Task> GetAsync(string resourceUr { case 200: { - StorageClassResourceData value = default; + ConnectedClusterStorageClassData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StorageClassResourceData.DeserializeStorageClassResourceData(document.RootElement); + value = ConnectedClusterStorageClassData.DeserializeConnectedClusterStorageClassData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((StorageClassResourceData)null, message.Response); + return Response.FromValue((ConnectedClusterStorageClassData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -177,7 +177,7 @@ public async Task> GetAsync(string resourceUr /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceUri, string storageClassName, CancellationToken cancellationToken = default) + public Response Get(string resourceUri, string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); @@ -188,19 +188,19 @@ public Response Get(string resourceUri, string storage { case 200: { - StorageClassResourceData value = default; + ConnectedClusterStorageClassData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StorageClassResourceData.DeserializeStorageClassResourceData(document.RootElement); + value = ConnectedClusterStorageClassData.DeserializeConnectedClusterStorageClassData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((StorageClassResourceData)null, message.Response); + return Response.FromValue((ConnectedClusterStorageClassData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string storageClassName, StorageClassResourceData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, string storageClassName, ConnectedClusterStorageClassData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -212,7 +212,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string resourceUri, st return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string storageClassName, StorageClassResourceData data) + internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string storageClassName, ConnectedClusterStorageClassData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -241,7 +241,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceUri, string stor /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string resourceUri, string storageClassName, StorageClassResourceData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string resourceUri, string storageClassName, ConnectedClusterStorageClassData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); @@ -266,7 +266,7 @@ public async Task CreateOrUpdateAsync(string resourceUri, string stora /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string resourceUri, string storageClassName, StorageClassResourceData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string resourceUri, string storageClassName, ConnectedClusterStorageClassData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); @@ -284,7 +284,7 @@ public Response CreateOrUpdate(string resourceUri, string storageClassName, Stor } } - internal RequestUriBuilder CreateUpdateRequestUri(string resourceUri, string storageClassName, StorageClassResourcePatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string resourceUri, string storageClassName, ConnectedClusterStorageClassPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -296,7 +296,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string resourceUri, string sto return uri; } - internal HttpMessage CreateUpdateRequest(string resourceUri, string storageClassName, StorageClassResourcePatch patch) + internal HttpMessage CreateUpdateRequest(string resourceUri, string storageClassName, ConnectedClusterStorageClassPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -325,7 +325,7 @@ internal HttpMessage CreateUpdateRequest(string resourceUri, string storageClass /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string resourceUri, string storageClassName, StorageClassResourcePatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string resourceUri, string storageClassName, ConnectedClusterStorageClassPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); @@ -350,7 +350,7 @@ public async Task UpdateAsync(string resourceUri, string storageClassN /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response Update(string resourceUri, string storageClassName, StorageClassResourcePatch patch, CancellationToken cancellationToken = default) + public Response Update(string resourceUri, string storageClassName, ConnectedClusterStorageClassPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceUri, nameof(resourceUri)); Argument.AssertNotNullOrEmpty(storageClassName, nameof(storageClassName)); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.Serialization.cs deleted file mode 100644 index 8614d57cef793..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ServiceResource.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.ContainerOrchestratorRuntime -{ - public partial class ServiceResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ServiceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ServiceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.Serialization.cs deleted file mode 100644 index 3be86aea9116e..0000000000000 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/StorageClassResource.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.ContainerOrchestratorRuntime -{ - public partial class StorageClassResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - StorageClassResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - StorageClassResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Properties/AssemblyInfo.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Properties/AssemblyInfo.cs index d9e5604da875f..f9f0f5ddbd711 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Properties/AssemblyInfo.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; -[assembly: Azure.Core.AzureResourceProviderNamespace("ContainerOrchestratorRuntime")] +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.KubernetesRuntime")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] [assembly: InternalsVisibleTo("Azure.ResourceManager.ContainerOrchestratorRuntime.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md.bak b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md similarity index 77% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md.bak rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md index dd130c0be8458..21e57cb586a3f 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md.bak +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md @@ -8,6 +8,7 @@ csharp: true library-name: ContainerOrchestratorRuntime namespace: Azure.ResourceManager.ContainerOrchestratorRuntime require: https://github.com/Azure/azure-rest-api-specs/blob/c02b366afa77a3e2a746719cea713b231b4b41bb/specification/kubernetesruntime/resource-manager/readme.md +tag: package-2024-03-01 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -17,15 +18,25 @@ skip-csproj: true modelerfour: flatten-payloads: false use-model-reader-writer: true -tag: package-2024-03-01 +use-write-core: true -# mgmt-debug: -# show-serialized-names: true +#mgmt-debug: +# show-serialized-names: true rename-mapping: + AccessMode: StorageClassAccessMode + AdvertiseMode.ARP: Arp + AdvertiseMode.BGP: Bgp + BgpPeer: ConnectedClusterBgpPeer + LoadBalancer: ConnectedClusterLoadBalancer + ServiceResource: ConnectedClusterService ServiceResource.properties.rpObjectId: -|uuid + StorageClassResource: ConnectedClusterStorageClass ProvisioningState: ContainerOrchestratorProvisioningState - AccessMode: StorageClassAccessMode + SCType: StorageClassType + SCType.RWX: Rwx + SCType.NFS: Nfs + SCType.SMB: Smb format-by-name-rules: 'tenantId': 'uuid' diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs index ae752f982e940..e2594524c36ce 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs @@ -24,20 +24,20 @@ public LoadBalancerTests() : base(true) public async Task CreateLoadBalancerAsync() { var connectedCluster = ConnectedClusterResource.CreateResourceIdentifier("b9e38f20-7c9c-4497-a25d-1a0c5eef2108", "xinyuhe-canary", "test-cluster-euap-arc"); - var loadBalancerCollection = new LoadBalancerCollection(Client, connectedCluster); - var loadBalancerData = new LoadBalancerData + var loadBalancerCollection = new ConnectedClusterLoadBalancerCollection(Client, connectedCluster); + var loadBalancerData = new ConnectedClusterLoadBalancerData { - AdvertiseMode = AdvertiseMode.ARP + AdvertiseMode = AdvertiseMode.Arp }; loadBalancerData.Addresses.Add("192.168.10.1/32"); await loadBalancerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testlb", loadBalancerData); - var bgpPeerData = new BgpPeerData + var bgpPeerData = new ConnectedClusterBgpPeerData { MyAsn = 64000, PeerAsn = 64001, PeerAddress = "192.168.2.0" }; - var bgpPeerCollection = new BgpPeerCollection(Client, connectedCluster); + var bgpPeerCollection = new ConnectedClusterBgpPeerCollection(Client, connectedCluster); await bgpPeerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testpeer", bgpPeerData); } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs index 21f3afde8029e..27dd9a0d4503b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs @@ -23,11 +23,11 @@ public StorageClassTests() : base(true) public async Task CreateStorageClassAsync() { var nfsStorageClassTypeProperties = new NfsStorageClassTypeProperties("172.23.1.4", "/"); - var storageClassData = new StorageClassResourceData + var storageClassData = new ConnectedClusterStorageClassData { TypeProperties = nfsStorageClassTypeProperties }; - var storageClassCollection = new StorageClassResourceCollection(Client, TestEnvironment.ConnectedCluster); + var storageClassCollection = new ConnectedClusterStorageClassCollection(Client, TestEnvironment.ConnectedCluster); await storageClassCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testsc", storageClassData); } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml.bak similarity index 100% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml.bak From 564b6979ec5c3946785c76cbd89e14d6e56a7054 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Fri, 27 Sep 2024 15:26:38 +0800 Subject: [PATCH 17/20] update --- ...ainerOrchestratorRuntime.netstandard2.0.cs | 180 ++++++---- ...ample_ConnectedClusterBgpPeerCollection.cs | 81 +++-- .../Sample_ConnectedClusterBgpPeerResource.cs | 11 +- ..._ConnectedClusterLoadBalancerCollection.cs | 87 ++--- ...le_ConnectedClusterLoadBalancerResource.cs | 17 +- ...ample_ConnectedClusterServiceCollection.cs | 82 ++--- .../Sample_ConnectedClusterServiceResource.cs | 12 +- ..._ConnectedClusterStorageClassCollection.cs | 78 ++--- ...le_ConnectedClusterStorageClassResource.cs | 6 +- ...ontainerOrchestratorRuntimeModelFactory.cs | 104 ++++-- .../ConnectedClusterBgpPeerCollection.cs | 4 +- ...nnectedClusterBgpPeerData.Serialization.cs | 87 +---- .../Generated/ConnectedClusterBgpPeerData.cs | 22 +- .../ConnectedClusterLoadBalancerCollection.cs | 4 +- ...edClusterLoadBalancerData.Serialization.cs | 138 +------- .../ConnectedClusterLoadBalancerData.cs | 29 +- .../ConnectedClusterServiceCollection.cs | 4 +- ...nnectedClusterServiceData.Serialization.cs | 59 +--- .../Generated/ConnectedClusterServiceData.cs | 14 +- .../ConnectedClusterStorageClassCollection.cs | 4 +- ...edClusterStorageClassData.Serialization.cs | 245 +------------ .../ConnectedClusterStorageClassData.cs | 65 +--- .../ContainerOrchestratorRuntimeExtensions.cs | 186 +++++----- ...leContainerOrchestratorRuntimeArmClient.cs | 168 ++++----- .../Models/BlobStorageClassTypeProperties.cs | 8 +- ...dClusterBgpPeerProperties.Serialization.cs | 157 +++++++++ .../ConnectedClusterBgpPeerProperties.cs | 91 +++++ ...terLoadBalancerProperties.Serialization.cs | 216 ++++++++++++ .../ConnectedClusterLoadBalancerProperties.cs | 96 +++++ ...dClusterServiceProperties.Serialization.cs | 148 ++++++++ .../ConnectedClusterServiceProperties.cs | 69 ++++ ...terStorageClassProperties.Serialization.cs | 330 ++++++++++++++++++ .../ConnectedClusterStorageClassProperties.cs | 134 +++++++ .../NativeStorageClassTypeProperties.cs | 8 +- .../Models/NfsStorageClassTypeProperties.cs | 8 +- .../Models/RwxStorageClassTypeProperties.cs | 8 +- .../Models/SmbStorageClassTypeProperties.cs | 8 +- ...torageClassTypeProperties.Serialization.cs | 2 +- .../Models/StorageClassTypeProperties.cs | 8 +- .../UnknownStorageClassTypeProperties.cs | 6 +- .../RestOperations/BgpPeersRestOperations.cs | 156 ++++----- .../LoadBalancersRestOperations.cs | 156 ++++----- .../RestOperations/ServicesRestOperations.cs | 156 ++++----- .../StorageClassRestOperations.cs | 156 ++++----- .../src/{autorest.md => autorest.md.bak} | 6 +- .../tests/Scenario/LoadBalancerTests.cs | 18 +- .../tests/Scenario/StorageClassTests.cs | 5 +- ...sp-location.yaml.bak => tsp-location.yaml} | 2 +- 48 files changed, 2231 insertions(+), 1408 deletions(-) create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterBgpPeerProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterBgpPeerProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterLoadBalancerProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterLoadBalancerProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterServiceProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterServiceProperties.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassProperties.Serialization.cs create mode 100644 sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassProperties.cs rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/{autorest.md => autorest.md.bak} (85%) rename sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/{tsp-location.yaml.bak => tsp-location.yaml} (69%) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs index bfe524ed0069c..713b8e03fb473 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/api/Azure.ResourceManager.ContainerOrchestratorRuntime.netstandard2.0.cs @@ -1,54 +1,51 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime { - public partial class BgpPeerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + public partial class ConnectedClusterBgpPeerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { - protected BgpPeerCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string bgpPeerName, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string bgpPeerName, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + protected ConnectedClusterBgpPeerCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string bgpPeerName, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string bgpPeerName, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class BgpPeerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ConnectedClusterBgpPeerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public BgpPeerData() { } - public int? MyAsn { get { throw null; } set { } } - public string PeerAddress { get { throw null; } set { } } - public int? PeerAsn { get { throw null; } set { } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } + public ConnectedClusterBgpPeerData() { } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterBgpPeerProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData 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.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData 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 BgpPeerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ConnectedClusterBgpPeerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected BgpPeerResource() { } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData Data { get { throw null; } } + protected ConnectedClusterBgpPeerResource() { } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string resourceUri, string bgpPeerName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ConnectedClusterLoadBalancerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -70,11 +67,7 @@ protected ConnectedClusterLoadBalancerCollection() { } public partial class ConnectedClusterLoadBalancerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConnectedClusterLoadBalancerData() { } - public System.Collections.Generic.IList Addresses { get { throw null; } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode? AdvertiseMode { get { throw null; } set { } } - public System.Collections.Generic.IList BgpPeers { get { throw null; } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } - public System.Collections.Generic.IDictionary ServiceSelector { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterLoadBalancerProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData 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) { } @@ -121,8 +114,7 @@ protected ConnectedClusterServiceCollection() { } public partial class ConnectedClusterServiceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConnectedClusterServiceData() { } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } - public System.Guid? RpObjectId { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterServiceProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData 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,18 +161,7 @@ protected ConnectedClusterStorageClassCollection() { } public partial class ConnectedClusterStorageClassData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConnectedClusterStorageClassData() { } - public System.Collections.Generic.IList AccessModes { get { throw null; } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? AllowVolumeExpansion { get { throw null; } set { } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? DataResilience { get { throw null; } set { } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? FailoverSpeed { get { throw null; } set { } } - public System.Collections.Generic.IList Limitations { get { throw null; } } - public System.Collections.Generic.IList MountOptions { get { throw null; } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? Performance { get { throw null; } set { } } - public long? Priority { get { throw null; } set { } } - public string Provisioner { get { throw null; } set { } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties TypeProperties { get { throw null; } set { } } - public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode? VolumeBindingMode { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterStorageClassProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData 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) { } @@ -209,10 +190,10 @@ protected ConnectedClusterStorageClassResource() { } } public static partial class ContainerOrchestratorRuntimeExtensions { - public static Azure.Response GetBgpPeer(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetBgpPeerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerResource GetBgpPeerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerCollection GetBgpPeers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.Response GetConnectedClusterBgpPeer(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConnectedClusterBgpPeerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerResource GetConnectedClusterBgpPeerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } public static Azure.Response GetConnectedClusterLoadBalancer(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetConnectedClusterLoadBalancerAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerResource GetConnectedClusterLoadBalancerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -232,10 +213,10 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Mocking public partial class MockableContainerOrchestratorRuntimeArmClient : Azure.ResourceManager.ArmResource { protected MockableContainerOrchestratorRuntimeArmClient() { } - public virtual Azure.Response GetBgpPeer(Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetBgpPeerAsync(Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerResource GetBgpPeerResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerCollection GetBgpPeers(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.Response GetConnectedClusterBgpPeer(Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedClusterBgpPeerAsync(Azure.Core.ResourceIdentifier scope, string bgpPeerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerResource GetConnectedClusterBgpPeerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(Azure.Core.ResourceIdentifier scope) { throw null; } public virtual Azure.Response GetConnectedClusterLoadBalancer(Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetConnectedClusterLoadBalancerAsync(Azure.Core.ResourceIdentifier scope, string loadBalancerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerResource GetConnectedClusterLoadBalancerResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -273,10 +254,14 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models } public static partial class ArmContainerOrchestratorRuntimeModelFactory { - public static Azure.ResourceManager.ContainerOrchestratorRuntime.BgpPeerData BgpPeerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? myAsn = default(int?), int? peerAsn = default(int?), string peerAddress = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData ConnectedClusterLoadBalancerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable addresses = null, System.Collections.Generic.IDictionary serviceSelector = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode? advertiseMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode?), System.Collections.Generic.IEnumerable bgpPeers = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData ConnectedClusterServiceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? rpObjectId = default(System.Guid?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData ConnectedClusterStorageClassData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? allowVolumeExpansion = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion?), System.Collections.Generic.IEnumerable mountOptions = null, string provisioner = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode? volumeBindingMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode?), System.Collections.Generic.IEnumerable accessModes = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? dataResilience = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? failoverSpeed = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier?), System.Collections.Generic.IEnumerable limitations = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? performance = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier?), long? priority = default(long?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties typeProperties = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterBgpPeerData ConnectedClusterBgpPeerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterBgpPeerProperties properties = null) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterBgpPeerProperties ConnectedClusterBgpPeerProperties(int myAsn = 0, int peerAsn = 0, string peerAddress = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterLoadBalancerData ConnectedClusterLoadBalancerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterLoadBalancerProperties properties = null) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterLoadBalancerProperties ConnectedClusterLoadBalancerProperties(System.Collections.Generic.IEnumerable addresses = null, System.Collections.Generic.IDictionary serviceSelector = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode advertiseMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode), System.Collections.Generic.IEnumerable bgpPeers = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterServiceData ConnectedClusterServiceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterServiceProperties properties = null) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterServiceProperties ConnectedClusterServiceProperties(System.Guid? rpObjectId = default(System.Guid?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.ConnectedClusterStorageClassData ConnectedClusterStorageClassData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterStorageClassProperties properties = null) { throw null; } + public static Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterStorageClassProperties ConnectedClusterStorageClassProperties(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? allowVolumeExpansion = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion?), System.Collections.Generic.IEnumerable mountOptions = null, string provisioner = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode? volumeBindingMode = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode?), System.Collections.Generic.IEnumerable accessModes = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? dataResilience = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? failoverSpeed = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier?), System.Collections.Generic.IEnumerable limitations = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? performance = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier?), long? priority = default(long?), Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties typeProperties = null, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState?)) { throw null; } } public partial class BlobStorageClassTypeProperties : Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -290,6 +275,47 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write 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 ConnectedClusterBgpPeerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedClusterBgpPeerProperties(int myAsn, int peerAsn, string peerAddress) { } + public int MyAsn { get { throw null; } set { } } + public string PeerAddress { get { throw null; } set { } } + public int PeerAsn { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterBgpPeerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterBgpPeerProperties 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 ConnectedClusterLoadBalancerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedClusterLoadBalancerProperties(System.Collections.Generic.IEnumerable addresses, Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode advertiseMode) { } + public System.Collections.Generic.IList Addresses { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.AdvertiseMode AdvertiseMode { get { throw null; } set { } } + public System.Collections.Generic.IList BgpPeers { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IDictionary ServiceSelector { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterLoadBalancerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterLoadBalancerProperties 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 ConnectedClusterServiceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedClusterServiceProperties() { } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } + public System.Guid? RpObjectId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterServiceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterServiceProperties 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 ConnectedClusterStorageClassPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConnectedClusterStorageClassPatch() { } @@ -301,6 +327,28 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 ConnectedClusterStorageClassProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedClusterStorageClassProperties(Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties typeProperties) { } + public System.Collections.Generic.IList AccessModes { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeExpansion? AllowVolumeExpansion { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.DataResilienceTier? DataResilience { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.FailoverTier? FailoverSpeed { get { throw null; } set { } } + public System.Collections.Generic.IList Limitations { get { throw null; } } + public System.Collections.Generic.IList MountOptions { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.PerformanceTier? Performance { get { throw null; } set { } } + public long? Priority { get { throw null; } set { } } + public string Provisioner { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ContainerOrchestratorProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.StorageClassTypeProperties TypeProperties { get { throw null; } set { } } + public Azure.ResourceManager.ContainerOrchestratorRuntime.Models.VolumeBindingMode? VolumeBindingMode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterStorageClassProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerOrchestratorRuntime.Models.ConnectedClusterStorageClassProperties 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 ContainerOrchestratorProvisioningState : System.IEquatable { diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerCollection.cs index 8b06969abdf21..0733af5a93cf7 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerCollection.cs @@ -9,51 +9,18 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { public partial class Sample_ConnectedClusterBgpPeerCollection { - // BgpPeers_List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_BgpPeersList() - { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_List.json - // this example is just showing the usage of "BgpPeers_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 ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this ConnectedClusterBgpPeerResource - string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - ConnectedClusterBgpPeerCollection collection = client.GetConnectedClusterBgpPeers(scopeId); - - // invoke the operation and iterate over the result - await foreach (ConnectedClusterBgpPeerResource 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 - ConnectedClusterBgpPeerData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - // BgpPeers_Get [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_BgpPeersGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Get.json + // Generated from example definition: 2024-03-01/BgpPeers_Get.json // this example is just showing the usage of "BgpPeers_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 @@ -85,7 +52,7 @@ public async Task Get_BgpPeersGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_BgpPeersGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Get.json + // Generated from example definition: 2024-03-01/BgpPeers_Get.json // this example is just showing the usage of "BgpPeers_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 @@ -113,7 +80,7 @@ public async Task Exists_BgpPeersGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_BgpPeersGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Get.json + // Generated from example definition: 2024-03-01/BgpPeers_Get.json // this example is just showing the usage of "BgpPeers_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 @@ -153,7 +120,7 @@ public async Task GetIfExists_BgpPeersGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_BgpPeersCreateOrUpdate() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_CreateOrUpdate.json + // Generated from example definition: 2024-03-01/BgpPeers_CreateOrUpdate.json // this example is just showing the usage of "BgpPeers_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 @@ -173,9 +140,7 @@ public async Task CreateOrUpdate_BgpPeersCreateOrUpdate() string bgpPeerName = "testpeer"; ConnectedClusterBgpPeerData data = new ConnectedClusterBgpPeerData() { - MyAsn = 64500, - PeerAsn = 64501, - PeerAddress = "10.0.0.1", + Properties = new ConnectedClusterBgpPeerProperties(64500, 64501, "10.0.0.1"), }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, bgpPeerName, data); ConnectedClusterBgpPeerResource result = lro.Value; @@ -186,5 +151,39 @@ public async Task CreateOrUpdate_BgpPeersCreateOrUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // BgpPeers_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_BgpPeersList() + { + // Generated from example definition: 2024-03-01/BgpPeers_List.json + // this example is just showing the usage of "BgpPeer_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this ConnectedClusterBgpPeerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + ConnectedClusterBgpPeerCollection collection = client.GetConnectedClusterBgpPeers(scopeId); + + // invoke the operation and iterate over the result + await foreach (ConnectedClusterBgpPeerResource 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 + ConnectedClusterBgpPeerData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerResource.cs index fc8406078e658..9e194a2f3a821 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterBgpPeerResource.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { @@ -19,7 +20,7 @@ public partial class Sample_ConnectedClusterBgpPeerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_BgpPeersGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Get.json + // Generated from example definition: 2024-03-01/BgpPeers_Get.json // this example is just showing the usage of "BgpPeers_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 @@ -49,7 +50,7 @@ public async Task Get_BgpPeersGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_BgpPeersCreateOrUpdate() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_CreateOrUpdate.json + // Generated from example definition: 2024-03-01/BgpPeers_CreateOrUpdate.json // this example is just showing the usage of "BgpPeers_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 @@ -67,9 +68,7 @@ public async Task Update_BgpPeersCreateOrUpdate() // invoke the operation ConnectedClusterBgpPeerData data = new ConnectedClusterBgpPeerData() { - MyAsn = 64500, - PeerAsn = 64501, - PeerAddress = "10.0.0.1", + Properties = new ConnectedClusterBgpPeerProperties(64500, 64501, "10.0.0.1"), }; ArmOperation lro = await connectedClusterBgpPeer.UpdateAsync(WaitUntil.Completed, data); ConnectedClusterBgpPeerResource result = lro.Value; @@ -86,7 +85,7 @@ public async Task Update_BgpPeersCreateOrUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_BgpPeersDelete() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/BgpPeers_Delete.json + // Generated from example definition: 2024-03-01/BgpPeers_Delete.json // this example is just showing the usage of "BgpPeers_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 diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerCollection.cs index 5aef4e1fa4acf..1c4e2af1d9a0a 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerCollection.cs @@ -15,46 +15,12 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { public partial class Sample_ConnectedClusterLoadBalancerCollection { - // LoadBalancers_List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_LoadBalancersList() - { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_List.json - // this example is just showing the usage of "LoadBalancers_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 ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this ConnectedClusterLoadBalancerResource - string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - ConnectedClusterLoadBalancerCollection collection = client.GetConnectedClusterLoadBalancers(scopeId); - - // invoke the operation and iterate over the result - await foreach (ConnectedClusterLoadBalancerResource 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 - ConnectedClusterLoadBalancerData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - // LoadBalancers_Get [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_LoadBalancersGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Get.json + // Generated from example definition: 2024-03-01/LoadBalancers_Get.json // this example is just showing the usage of "LoadBalancers_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 @@ -86,7 +52,7 @@ public async Task Get_LoadBalancersGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_LoadBalancersGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Get.json + // Generated from example definition: 2024-03-01/LoadBalancers_Get.json // this example is just showing the usage of "LoadBalancers_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 @@ -114,7 +80,7 @@ public async Task Exists_LoadBalancersGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_LoadBalancersGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Get.json + // Generated from example definition: 2024-03-01/LoadBalancers_Get.json // this example is just showing the usage of "LoadBalancers_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 @@ -154,7 +120,7 @@ public async Task GetIfExists_LoadBalancersGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_LoadBalancersCreateOrUpdate() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_CreateOrUpdate.json + // Generated from example definition: 2024-03-01/LoadBalancers_CreateOrUpdate.json // this example is just showing the usage of "LoadBalancers_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 @@ -174,15 +140,16 @@ public async Task CreateOrUpdate_LoadBalancersCreateOrUpdate() string loadBalancerName = "testlb"; ConnectedClusterLoadBalancerData data = new ConnectedClusterLoadBalancerData() { - Addresses = -{ + Properties = new ConnectedClusterLoadBalancerProperties(new string[] + { "192.168.50.1/24","192.168.51.2-192.168.51.10" -}, - ServiceSelector = + }, AdvertiseMode.Arp) + { + ServiceSelector = { ["app"] = "frontend", }, - AdvertiseMode = AdvertiseMode.Arp, + }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, loadBalancerName, data); ConnectedClusterLoadBalancerResource result = lro.Value; @@ -193,5 +160,39 @@ public async Task CreateOrUpdate_LoadBalancersCreateOrUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // LoadBalancers_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_LoadBalancersList() + { + // Generated from example definition: 2024-03-01/LoadBalancers_List.json + // this example is just showing the usage of "LoadBalancer_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this ConnectedClusterLoadBalancerResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + ConnectedClusterLoadBalancerCollection collection = client.GetConnectedClusterLoadBalancers(scopeId); + + // invoke the operation and iterate over the result + await foreach (ConnectedClusterLoadBalancerResource 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 + ConnectedClusterLoadBalancerData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerResource.cs index 8b79a14f100a3..aa214027c2a9a 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterLoadBalancerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ConnectedClusterLoadBalancerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_LoadBalancersGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Get.json + // Generated from example definition: 2024-03-01/LoadBalancers_Get.json // this example is just showing the usage of "LoadBalancers_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 @@ -50,7 +50,7 @@ public async Task Get_LoadBalancersGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_LoadBalancersCreateOrUpdate() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_CreateOrUpdate.json + // Generated from example definition: 2024-03-01/LoadBalancers_CreateOrUpdate.json // this example is just showing the usage of "LoadBalancers_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 @@ -68,15 +68,16 @@ public async Task Update_LoadBalancersCreateOrUpdate() // invoke the operation ConnectedClusterLoadBalancerData data = new ConnectedClusterLoadBalancerData() { - Addresses = -{ + Properties = new ConnectedClusterLoadBalancerProperties(new string[] + { "192.168.50.1/24","192.168.51.2-192.168.51.10" -}, - ServiceSelector = + }, AdvertiseMode.Arp) + { + ServiceSelector = { ["app"] = "frontend", }, - AdvertiseMode = AdvertiseMode.Arp, + }, }; ArmOperation lro = await connectedClusterLoadBalancer.UpdateAsync(WaitUntil.Completed, data); ConnectedClusterLoadBalancerResource result = lro.Value; @@ -93,7 +94,7 @@ public async Task Update_LoadBalancersCreateOrUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_LoadBalancersDelete() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/LoadBalancers_Delete.json + // Generated from example definition: 2024-03-01/LoadBalancers_Delete.json // this example is just showing the usage of "LoadBalancers_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 diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceCollection.cs index 0fc4f74ca0d32..2283458223758 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceCollection.cs @@ -9,51 +9,18 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { public partial class Sample_ConnectedClusterServiceCollection { - // Services_List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ServicesList() - { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_List.json - // this example is just showing the usage of "Services_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 ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this ConnectedClusterServiceResource - string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - ConnectedClusterServiceCollection collection = client.GetConnectedClusterServices(scopeId); - - // invoke the operation and iterate over the result - await foreach (ConnectedClusterServiceResource 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 - ConnectedClusterServiceData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - // Services_Get [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ServicesGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Get.json + // Generated from example definition: 2024-03-01/Services_Get.json // this example is just showing the usage of "Services_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 @@ -85,7 +52,7 @@ public async Task Get_ServicesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_ServicesGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Get.json + // Generated from example definition: 2024-03-01/Services_Get.json // this example is just showing the usage of "Services_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 @@ -113,7 +80,7 @@ public async Task Exists_ServicesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_ServicesGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Get.json + // Generated from example definition: 2024-03-01/Services_Get.json // this example is just showing the usage of "Services_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 @@ -153,7 +120,7 @@ public async Task GetIfExists_ServicesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ServicesCreateOrUpdate() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_CreateOrUpdate.json + // Generated from example definition: 2024-03-01/Services_CreateOrUpdate.json // this example is just showing the usage of "Services_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 @@ -171,7 +138,10 @@ public async Task CreateOrUpdate_ServicesCreateOrUpdate() // invoke the operation string serviceName = "storageclass"; - ConnectedClusterServiceData data = new ConnectedClusterServiceData(); + ConnectedClusterServiceData data = new ConnectedClusterServiceData() + { + Properties = new ConnectedClusterServiceProperties(), + }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data); ConnectedClusterServiceResource result = lro.Value; @@ -181,5 +151,39 @@ public async Task CreateOrUpdate_ServicesCreateOrUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Services_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ServicesList() + { + // Generated from example definition: 2024-03-01/Services_List.json + // this example is just showing the usage of "ServiceResource_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this ConnectedClusterServiceResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + ConnectedClusterServiceCollection collection = client.GetConnectedClusterServices(scopeId); + + // invoke the operation and iterate over the result + await foreach (ConnectedClusterServiceResource 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 + ConnectedClusterServiceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceResource.cs index 3ea04e049e616..f17f338e508b1 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterServiceResource.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { @@ -19,7 +20,7 @@ public partial class Sample_ConnectedClusterServiceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ServicesGet() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Get.json + // Generated from example definition: 2024-03-01/Services_Get.json // this example is just showing the usage of "Services_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 @@ -49,7 +50,7 @@ public async Task Get_ServicesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ServicesCreateOrUpdate() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_CreateOrUpdate.json + // Generated from example definition: 2024-03-01/Services_CreateOrUpdate.json // this example is just showing the usage of "Services_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 @@ -65,7 +66,10 @@ public async Task Update_ServicesCreateOrUpdate() ConnectedClusterServiceResource connectedClusterService = client.GetConnectedClusterServiceResource(connectedClusterServiceResourceId); // invoke the operation - ConnectedClusterServiceData data = new ConnectedClusterServiceData(); + ConnectedClusterServiceData data = new ConnectedClusterServiceData() + { + Properties = new ConnectedClusterServiceProperties(), + }; ArmOperation lro = await connectedClusterService.UpdateAsync(WaitUntil.Completed, data); ConnectedClusterServiceResource result = lro.Value; @@ -81,7 +85,7 @@ public async Task Update_ServicesCreateOrUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ServicesDelete() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/Services_Delete.json + // Generated from example definition: 2024-03-01/Services_Delete.json // this example is just showing the usage of "Services_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 diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassCollection.cs index 6b15cbf55e22b..ed2fd49c78f9d 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassCollection.cs @@ -15,46 +15,12 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Samples { public partial class Sample_ConnectedClusterStorageClassCollection { - // StorageClass_List_0 - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_StorageClassList0() - { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_List.json - // this example is just showing the usage of "StorageClass_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 ArmResource created on azure - // for more information of creating ArmResource, please refer to the document of ArmResource - - // get the collection of this ConnectedClusterStorageClassResource - string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; - ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - ConnectedClusterStorageClassCollection collection = client.GetConnectedClusterStorageClasses(scopeId); - - // invoke the operation and iterate over the result - await foreach (ConnectedClusterStorageClassResource 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 - ConnectedClusterStorageClassData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - // StorageClass_Get_0 [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_StorageClassGet0() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Get.json + // Generated from example definition: 2024-03-01/StorageClass_Get.json // this example is just showing the usage of "StorageClass_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 @@ -86,7 +52,7 @@ public async Task Get_StorageClassGet0() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_StorageClassGet0() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Get.json + // Generated from example definition: 2024-03-01/StorageClass_Get.json // this example is just showing the usage of "StorageClass_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 @@ -114,7 +80,7 @@ public async Task Exists_StorageClassGet0() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_StorageClassGet0() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Get.json + // Generated from example definition: 2024-03-01/StorageClass_Get.json // this example is just showing the usage of "StorageClass_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 @@ -154,7 +120,7 @@ public async Task GetIfExists_StorageClassGet0() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_StorageClassCreateOrUpdate0() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_CreateOrUpdate.json + // Generated from example definition: 2024-03-01/StorageClass_CreateOrUpdate.json // this example is just showing the usage of "StorageClass_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 @@ -174,7 +140,7 @@ public async Task CreateOrUpdate_StorageClassCreateOrUpdate0() string storageClassName = "testrwx"; ConnectedClusterStorageClassData data = new ConnectedClusterStorageClassData() { - TypeProperties = new RwxStorageClassTypeProperties("default"), + Properties = new ConnectedClusterStorageClassProperties(new RwxStorageClassTypeProperties("default")), }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, storageClassName, data); ConnectedClusterStorageClassResource result = lro.Value; @@ -185,5 +151,39 @@ public async Task CreateOrUpdate_StorageClassCreateOrUpdate0() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // StorageClass_List_0 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_StorageClassList0() + { + // Generated from example definition: 2024-03-01/StorageClass_List.json + // this example is just showing the usage of "StorageClassResource_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 ArmResource created on azure + // for more information of creating ArmResource, please refer to the document of ArmResource + + // get the collection of this ConnectedClusterStorageClassResource + string resourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"; + ResourceIdentifier scopeId = new ResourceIdentifier(string.Format("/{0}", resourceUri)); + ConnectedClusterStorageClassCollection collection = client.GetConnectedClusterStorageClasses(scopeId); + + // invoke the operation and iterate over the result + await foreach (ConnectedClusterStorageClassResource 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 + ConnectedClusterStorageClassData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassResource.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassResource.cs index 1d2db495f3d58..2e2866223353d 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassResource.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/samples/Generated/Samples/Sample_ConnectedClusterStorageClassResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ConnectedClusterStorageClassResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_StorageClassGet0() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Get.json + // Generated from example definition: 2024-03-01/StorageClass_Get.json // this example is just showing the usage of "StorageClass_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 @@ -50,7 +50,7 @@ public async Task Get_StorageClassGet0() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_StorageClassUpdate0() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Update.json + // Generated from example definition: 2024-03-01/StorageClass_Update.json // this example is just showing the usage of "StorageClass_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 @@ -91,7 +91,7 @@ public async Task Update_StorageClassUpdate0() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_StorageClassDelete0() { - // Generated from example definition: specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/examples/StorageClass_Delete.json + // Generated from example definition: 2024-03-01/StorageClass_Delete.json // this example is just showing the usage of "StorageClass_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 diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs index cbe24362ba789..f33ab58d1c2e4 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ArmContainerOrchestratorRuntimeModelFactory.cs @@ -16,52 +16,94 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models /// Model factory for models. public static partial class ArmContainerOrchestratorRuntimeModelFactory { - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// My ASN. - /// Peer ASN. - /// Peer Address. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static ConnectedClusterServiceData ConnectedClusterServiceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ConnectedClusterServiceProperties properties = null) + { + return new ConnectedClusterServiceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The object id of the service principal of the RP provisioned in the tenant. /// Resource provision state. + /// A new instance for mocking. + public static ConnectedClusterServiceProperties ConnectedClusterServiceProperties(Guid? rpObjectId = null, ContainerOrchestratorProvisioningState? provisioningState = null) + { + return new ConnectedClusterServiceProperties(rpObjectId, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. /// A new instance for mocking. - public static ConnectedClusterBgpPeerData ConnectedClusterBgpPeerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? myAsn = null, int? peerAsn = null, string peerAddress = null, ContainerOrchestratorProvisioningState? provisioningState = null) + public static ConnectedClusterBgpPeerData ConnectedClusterBgpPeerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ConnectedClusterBgpPeerProperties properties = null) { return new ConnectedClusterBgpPeerData( id, name, resourceType, systemData, - myAsn, - peerAsn, - peerAddress, - provisioningState, + properties, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// My ASN. + /// Peer ASN. + /// Peer Address. + /// Resource provision state. + /// A new instance for mocking. + public static ConnectedClusterBgpPeerProperties ConnectedClusterBgpPeerProperties(int myAsn = default, int peerAsn = default, string peerAddress = null, ContainerOrchestratorProvisioningState? provisioningState = null) + { + return new ConnectedClusterBgpPeerProperties(myAsn, peerAsn, peerAddress, provisioningState, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static ConnectedClusterLoadBalancerData ConnectedClusterLoadBalancerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ConnectedClusterLoadBalancerProperties properties = null) + { + return new ConnectedClusterLoadBalancerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// IP Range. /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label "a=b", then please specify {"a": "b"} in the field. /// Advertise Mode. /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. /// Resource provision state. - /// A new instance for mocking. - public static ConnectedClusterLoadBalancerData ConnectedClusterLoadBalancerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable addresses = null, IDictionary serviceSelector = null, AdvertiseMode? advertiseMode = null, IEnumerable bgpPeers = null, ContainerOrchestratorProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static ConnectedClusterLoadBalancerProperties ConnectedClusterLoadBalancerProperties(IEnumerable addresses = null, IDictionary serviceSelector = null, AdvertiseMode advertiseMode = default, IEnumerable bgpPeers = null, ContainerOrchestratorProvisioningState? provisioningState = null) { addresses ??= new List(); serviceSelector ??= new Dictionary(); bgpPeers ??= new List(); - return new ConnectedClusterLoadBalancerData( - id, - name, - resourceType, - systemData, + return new ConnectedClusterLoadBalancerProperties( addresses?.ToList(), serviceSelector, advertiseMode, @@ -70,31 +112,25 @@ public static ConnectedClusterLoadBalancerData ConnectedClusterLoadBalancerData( serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The object id of the service principal of the RP provisioned in the tenant. - /// Resource provision state. - /// A new instance for mocking. - public static ConnectedClusterServiceData ConnectedClusterServiceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? rpObjectId = null, ContainerOrchestratorProvisioningState? provisioningState = null) + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static ConnectedClusterStorageClassData ConnectedClusterStorageClassData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ConnectedClusterStorageClassProperties properties = null) { - return new ConnectedClusterServiceData( + return new ConnectedClusterStorageClassData( id, name, resourceType, systemData, - rpObjectId, - provisioningState, + properties, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// Initializes a new instance of . /// Volume can be expanded or not. /// Additional mount options. /// Provisioner name. @@ -111,18 +147,14 @@ public static ConnectedClusterServiceData ConnectedClusterServiceData(ResourceId /// The available derived classes include , , , and . /// /// Resource provision state. - /// A new instance for mocking. - public static ConnectedClusterStorageClassData ConnectedClusterStorageClassData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeExpansion? allowVolumeExpansion = null, IEnumerable mountOptions = null, string provisioner = null, VolumeBindingMode? volumeBindingMode = null, IEnumerable accessModes = null, DataResilienceTier? dataResilience = null, FailoverTier? failoverSpeed = null, IEnumerable limitations = null, PerformanceTier? performance = null, long? priority = null, StorageClassTypeProperties typeProperties = null, ContainerOrchestratorProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static ConnectedClusterStorageClassProperties ConnectedClusterStorageClassProperties(VolumeExpansion? allowVolumeExpansion = null, IEnumerable mountOptions = null, string provisioner = null, VolumeBindingMode? volumeBindingMode = null, IEnumerable accessModes = null, DataResilienceTier? dataResilience = null, FailoverTier? failoverSpeed = null, IEnumerable limitations = null, PerformanceTier? performance = null, long? priority = null, StorageClassTypeProperties typeProperties = null, ContainerOrchestratorProvisioningState? provisioningState = null) { mountOptions ??= new List(); accessModes ??= new List(); limitations ??= new List(); - return new ConnectedClusterStorageClassData( - id, - name, - resourceType, - systemData, + return new ConnectedClusterStorageClassProperties( allowVolumeExpansion, mountOptions?.ToList(), provisioner, diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerCollection.cs index d48fcfcc606a9..67264f01a56f7 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerCollection.cs @@ -238,7 +238,7 @@ public virtual Response Get(string bgpPeerName, /// /// /// Operation Id - /// BgpPeers_List + /// BgpPeer_List /// /// /// Default Api Version @@ -268,7 +268,7 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Operation Id - /// BgpPeers_List + /// BgpPeer_List /// /// /// Default Api Version diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.Serialization.cs index a4ccfcce3d2ba..31d9f261812b7 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.Serialization.cs @@ -37,29 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(MyAsn)) - { - writer.WritePropertyName("myAsn"u8); - writer.WriteNumberValue(MyAsn.Value); - } - if (Optional.IsDefined(PeerAsn)) - { - writer.WritePropertyName("peerAsn"u8); - writer.WriteNumberValue(PeerAsn.Value); - } - if (Optional.IsDefined(PeerAddress)) - { - writer.WritePropertyName("peerAddress"u8); - writer.WriteStringValue(PeerAddress); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndObject(); } ConnectedClusterBgpPeerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -82,18 +64,24 @@ internal static ConnectedClusterBgpPeerData DeserializeConnectedClusterBgpPeerDa { return null; } + ConnectedClusterBgpPeerProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - int? myAsn = default; - int? peerAsn = default; - string peerAddress = default; - ContainerOrchestratorProvisioningState? provisioningState = 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 = ConnectedClusterBgpPeerProperties.DeserializeConnectedClusterBgpPeerProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -118,50 +106,6 @@ internal static ConnectedClusterBgpPeerData DeserializeConnectedClusterBgpPeerDa 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("myAsn"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - myAsn = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("peerAsn"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - peerAsn = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("peerAddress"u8)) - { - peerAddress = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new ContainerOrchestratorProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -173,10 +117,7 @@ internal static ConnectedClusterBgpPeerData DeserializeConnectedClusterBgpPeerDa name, type, systemData, - myAsn, - peerAsn, - peerAddress, - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.cs index 64b0f7997cdf9..e8ec52c25c3a8 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterBgpPeerData.cs @@ -61,27 +61,15 @@ public ConnectedClusterBgpPeerData() /// The name. /// The resourceType. /// The systemData. - /// My ASN. - /// Peer ASN. - /// Peer Address. - /// Resource provision state. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal ConnectedClusterBgpPeerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? myAsn, int? peerAsn, string peerAddress, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ConnectedClusterBgpPeerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ConnectedClusterBgpPeerProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - MyAsn = myAsn; - PeerAsn = peerAsn; - PeerAddress = peerAddress; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// My ASN. - public int? MyAsn { get; set; } - /// Peer ASN. - public int? PeerAsn { get; set; } - /// Peer Address. - public string PeerAddress { get; set; } - /// Resource provision state. - public ContainerOrchestratorProvisioningState? ProvisioningState { get; } + /// The resource-specific properties for this resource. + public ConnectedClusterBgpPeerProperties Properties { get; set; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerCollection.cs index 3616fb8fece25..a724f2f76bd19 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerCollection.cs @@ -238,7 +238,7 @@ public virtual Response Get(string loadBal /// /// /// Operation Id - /// LoadBalancers_List + /// LoadBalancer_List /// /// /// Default Api Version @@ -268,7 +268,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Operation Id - /// LoadBalancers_List + /// LoadBalancer_List /// /// /// Default Api Version diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.Serialization.cs index 77511c171a9b7..ee12812955414 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.Serialization.cs @@ -37,50 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Addresses)) - { - writer.WritePropertyName("addresses"u8); - writer.WriteStartArray(); - foreach (var item in Addresses) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ServiceSelector)) - { - writer.WritePropertyName("serviceSelector"u8); - writer.WriteStartObject(); - foreach (var item in ServiceSelector) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(AdvertiseMode)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("advertiseMode"u8); - writer.WriteStringValue(AdvertiseMode.Value.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(BgpPeers)) - { - writer.WritePropertyName("bgpPeers"u8); - writer.WriteStartArray(); - foreach (var item in BgpPeers) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); } ConnectedClusterLoadBalancerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -103,19 +64,24 @@ internal static ConnectedClusterLoadBalancerData DeserializeConnectedClusterLoad { return null; } + ConnectedClusterLoadBalancerProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - IList addresses = default; - IDictionary serviceSelector = default; - AdvertiseMode? advertiseMode = default; - IList bgpPeers = default; - ContainerOrchestratorProvisioningState? provisioningState = 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 = ConnectedClusterLoadBalancerProperties.DeserializeConnectedClusterLoadBalancerProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -140,78 +106,6 @@ internal static ConnectedClusterLoadBalancerData DeserializeConnectedClusterLoad 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("addresses"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - addresses = array; - continue; - } - if (property0.NameEquals("serviceSelector"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()); - } - serviceSelector = dictionary; - continue; - } - if (property0.NameEquals("advertiseMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - advertiseMode = new AdvertiseMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("bgpPeers"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - bgpPeers = array; - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new ContainerOrchestratorProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -223,11 +117,7 @@ internal static ConnectedClusterLoadBalancerData DeserializeConnectedClusterLoad name, type, systemData, - addresses ?? new ChangeTrackingList(), - serviceSelector ?? new ChangeTrackingDictionary(), - advertiseMode, - bgpPeers ?? new ChangeTrackingList(), - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.cs index 8550dfa7a8a06..a60a5c3712baf 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterLoadBalancerData.cs @@ -54,9 +54,6 @@ public partial class ConnectedClusterLoadBalancerData : ResourceData /// Initializes a new instance of . public ConnectedClusterLoadBalancerData() { - Addresses = new ChangeTrackingList(); - ServiceSelector = new ChangeTrackingDictionary(); - BgpPeers = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -64,31 +61,15 @@ public ConnectedClusterLoadBalancerData() /// The name. /// The resourceType. /// The systemData. - /// IP Range. - /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label "a=b", then please specify {"a": "b"} in the field. - /// Advertise Mode. - /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. - /// Resource provision state. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal ConnectedClusterLoadBalancerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList addresses, IDictionary serviceSelector, AdvertiseMode? advertiseMode, IList bgpPeers, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ConnectedClusterLoadBalancerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ConnectedClusterLoadBalancerProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - Addresses = addresses; - ServiceSelector = serviceSelector; - AdvertiseMode = advertiseMode; - BgpPeers = bgpPeers; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// IP Range. - public IList Addresses { get; } - /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label "a=b", then please specify {"a": "b"} in the field. - public IDictionary ServiceSelector { get; } - /// Advertise Mode. - public AdvertiseMode? AdvertiseMode { get; set; } - /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. - public IList BgpPeers { get; } - /// Resource provision state. - public ContainerOrchestratorProvisioningState? ProvisioningState { get; } + /// The resource-specific properties for this resource. + public ConnectedClusterLoadBalancerProperties Properties { get; set; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceCollection.cs index dfe50818ad91d..6e23faa75c37c 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceCollection.cs @@ -242,7 +242,7 @@ public virtual Response Get(string serviceName, /// /// /// Operation Id - /// Services_List + /// ServiceResource_List /// /// /// Default Api Version @@ -272,7 +272,7 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Operation Id - /// Services_List + /// ServiceResource_List /// /// /// Default Api Version diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.Serialization.cs index 4fad1e2caed3a..a057f3831122b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.Serialization.cs @@ -37,19 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(RpObjectId)) - { - writer.WritePropertyName("rpObjectId"u8); - writer.WriteStringValue(RpObjectId.Value); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndObject(); } ConnectedClusterServiceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -72,16 +64,24 @@ internal static ConnectedClusterServiceData DeserializeConnectedClusterServiceDa { return null; } + ConnectedClusterServiceProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - Guid? rpObjectId = default; - ContainerOrchestratorProvisioningState? provisioningState = 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 = ConnectedClusterServiceProperties.DeserializeConnectedClusterServiceProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -106,36 +106,6 @@ internal static ConnectedClusterServiceData DeserializeConnectedClusterServiceDa 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("rpObjectId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - rpObjectId = property0.Value.GetGuid(); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new ContainerOrchestratorProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -147,8 +117,7 @@ internal static ConnectedClusterServiceData DeserializeConnectedClusterServiceDa name, type, systemData, - rpObjectId, - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.cs index 082afa6358563..cc86f87ed5d56 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterServiceData.cs @@ -61,19 +61,15 @@ public ConnectedClusterServiceData() /// The name. /// The resourceType. /// The systemData. - /// The object id of the service principal of the RP provisioned in the tenant. - /// Resource provision state. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal ConnectedClusterServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? rpObjectId, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ConnectedClusterServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ConnectedClusterServiceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - RpObjectId = rpObjectId; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The object id of the service principal of the RP provisioned in the tenant. - public Guid? RpObjectId { get; } - /// Resource provision state. - public ContainerOrchestratorProvisioningState? ProvisioningState { get; } + /// The resource-specific properties for this resource. + public ConnectedClusterServiceProperties Properties { get; set; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassCollection.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassCollection.cs index 7b44dc851013b..3c5aa7d353733 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassCollection.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassCollection.cs @@ -238,7 +238,7 @@ public virtual Response Get(string storage /// /// /// Operation Id - /// StorageClass_List + /// StorageClassResource_List /// /// /// Default Api Version @@ -268,7 +268,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Operation Id - /// StorageClass_List + /// StorageClassResource_List /// /// /// Default Api Version diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.Serialization.cs index 087fe4bf1dd81..0a775d108c052 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.Serialization.cs @@ -37,84 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(AllowVolumeExpansion)) - { - writer.WritePropertyName("allowVolumeExpansion"u8); - writer.WriteStringValue(AllowVolumeExpansion.Value.ToString()); - } - if (Optional.IsCollectionDefined(MountOptions)) - { - writer.WritePropertyName("mountOptions"u8); - writer.WriteStartArray(); - foreach (var item in MountOptions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Provisioner)) - { - writer.WritePropertyName("provisioner"u8); - writer.WriteStringValue(Provisioner); - } - if (Optional.IsDefined(VolumeBindingMode)) - { - writer.WritePropertyName("volumeBindingMode"u8); - writer.WriteStringValue(VolumeBindingMode.Value.ToString()); - } - if (Optional.IsCollectionDefined(AccessModes)) - { - writer.WritePropertyName("accessModes"u8); - writer.WriteStartArray(); - foreach (var item in AccessModes) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DataResilience)) - { - writer.WritePropertyName("dataResilience"u8); - writer.WriteStringValue(DataResilience.Value.ToString()); - } - if (Optional.IsDefined(FailoverSpeed)) - { - writer.WritePropertyName("failoverSpeed"u8); - writer.WriteStringValue(FailoverSpeed.Value.ToString()); - } - if (Optional.IsCollectionDefined(Limitations)) - { - writer.WritePropertyName("limitations"u8); - writer.WriteStartArray(); - foreach (var item in Limitations) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Performance)) - { - writer.WritePropertyName("performance"u8); - writer.WriteStringValue(Performance.Value.ToString()); - } - if (Optional.IsDefined(Priority)) - { - writer.WritePropertyName("priority"u8); - writer.WriteNumberValue(Priority.Value); - } - if (Optional.IsDefined(TypeProperties)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("typeProperties"u8); - writer.WriteObjectValue(TypeProperties, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); } ConnectedClusterStorageClassData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -137,26 +64,24 @@ internal static ConnectedClusterStorageClassData DeserializeConnectedClusterStor { return null; } + ConnectedClusterStorageClassProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - VolumeExpansion? allowVolumeExpansion = default; - IList mountOptions = default; - string provisioner = default; - VolumeBindingMode? volumeBindingMode = default; - IList accessModes = default; - DataResilienceTier? dataResilience = default; - FailoverTier? failoverSpeed = default; - IList limitations = default; - PerformanceTier? performance = default; - long? priority = default; - StorageClassTypeProperties typeProperties = default; - ContainerOrchestratorProvisioningState? provisioningState = 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 = ConnectedClusterStorageClassProperties.DeserializeConnectedClusterStorageClassProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -181,137 +106,6 @@ internal static ConnectedClusterStorageClassData DeserializeConnectedClusterStor 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("allowVolumeExpansion"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - allowVolumeExpansion = new VolumeExpansion(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("mountOptions"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - mountOptions = array; - continue; - } - if (property0.NameEquals("provisioner"u8)) - { - provisioner = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("volumeBindingMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - volumeBindingMode = new VolumeBindingMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accessModes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new StorageClassAccessMode(item.GetString())); - } - accessModes = array; - continue; - } - if (property0.NameEquals("dataResilience"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - dataResilience = new DataResilienceTier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("failoverSpeed"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - failoverSpeed = new FailoverTier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("limitations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - limitations = array; - continue; - } - if (property0.NameEquals("performance"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - performance = new PerformanceTier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("priority"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - priority = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("typeProperties"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - typeProperties = StorageClassTypeProperties.DeserializeStorageClassTypeProperties(property0.Value, options); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new ContainerOrchestratorProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -323,18 +117,7 @@ internal static ConnectedClusterStorageClassData DeserializeConnectedClusterStor name, type, systemData, - allowVolumeExpansion, - mountOptions ?? new ChangeTrackingList(), - provisioner, - volumeBindingMode, - accessModes ?? new ChangeTrackingList(), - dataResilience, - failoverSpeed, - limitations ?? new ChangeTrackingList(), - performance, - priority, - typeProperties, - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.cs index a8010a10aa6ac..681dfac412f01 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/ConnectedClusterStorageClassData.cs @@ -54,9 +54,6 @@ public partial class ConnectedClusterStorageClassData : ResourceData /// Initializes a new instance of . public ConnectedClusterStorageClassData() { - MountOptions = new ChangeTrackingList(); - AccessModes = new ChangeTrackingList(); - Limitations = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -64,67 +61,15 @@ public ConnectedClusterStorageClassData() /// The name. /// The resourceType. /// The systemData. - /// Volume can be expanded or not. - /// Additional mount options. - /// Provisioner name. - /// Binding mode of volumes: Immediate, WaitForFirstConsumer. - /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. - /// Allow single data node failure. - /// Failover speed: NA, Slow, Fast. - /// Limitations of the storage class. - /// Performance tier. - /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. - /// - /// Properties of the StorageClass - /// 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 , , , and . - /// - /// Resource provision state. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal ConnectedClusterStorageClassData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeExpansion? allowVolumeExpansion, IList mountOptions, string provisioner, VolumeBindingMode? volumeBindingMode, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypeProperties typeProperties, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ConnectedClusterStorageClassData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ConnectedClusterStorageClassProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - AllowVolumeExpansion = allowVolumeExpansion; - MountOptions = mountOptions; - Provisioner = provisioner; - VolumeBindingMode = volumeBindingMode; - AccessModes = accessModes; - DataResilience = dataResilience; - FailoverSpeed = failoverSpeed; - Limitations = limitations; - Performance = performance; - Priority = priority; - TypeProperties = typeProperties; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Volume can be expanded or not. - public VolumeExpansion? AllowVolumeExpansion { get; set; } - /// Additional mount options. - public IList MountOptions { get; } - /// Provisioner name. - public string Provisioner { get; set; } - /// Binding mode of volumes: Immediate, WaitForFirstConsumer. - public VolumeBindingMode? VolumeBindingMode { get; set; } - /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. - public IList AccessModes { get; } - /// Allow single data node failure. - public DataResilienceTier? DataResilience { get; set; } - /// Failover speed: NA, Slow, Fast. - public FailoverTier? FailoverSpeed { get; set; } - /// Limitations of the storage class. - public IList Limitations { get; } - /// Performance tier. - public PerformanceTier? Performance { get; set; } - /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. - public long? Priority { get; set; } - /// - /// Properties of the StorageClass - /// 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 , , , and . - /// - public StorageClassTypeProperties TypeProperties { get; set; } - /// Resource provision state. - public ContainerOrchestratorProvisioningState? ProvisioningState { get; } + /// The resource-specific properties for this resource. + public ConnectedClusterStorageClassProperties Properties { get; set; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs index d969588783a11..493e4ab2687ba 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/ContainerOrchestratorRuntimeExtensions.cs @@ -22,33 +22,33 @@ private static MockableContainerOrchestratorRuntimeArmClient GetMockableContaine } /// - /// Gets a collection of ConnectedClusterBgpPeerResources in the ArmClient. + /// Gets a collection of ConnectedClusterStorageClassResources in the ArmClient. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// is null. - /// An object representing collection of ConnectedClusterBgpPeerResources and their operations over a ConnectedClusterBgpPeerResource. - public static ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(this ArmClient client, ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterStorageClassResources and their operations over a ConnectedClusterStorageClassResource. + public static ConnectedClusterStorageClassCollection GetConnectedClusterStorageClasses(this ArmClient client, ResourceIdentifier scope) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeers(scope); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClasses(scope); } /// - /// Get a BgpPeer + /// Get a StorageClassResource /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} /// /// /// Operation Id - /// BgpPeers_Get + /// StorageClass_Get /// /// /// Default Api Version @@ -56,38 +56,38 @@ public static ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(this /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. - /// The name of the BgpPeer. + /// The name of the the storage class. /// 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> GetConnectedClusterBgpPeerAsync(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + public static async Task> GetConnectedClusterStorageClassAsync(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeerAsync(scope, bgpPeerName, cancellationToken).ConfigureAwait(false); + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClassAsync(scope, storageClassName, cancellationToken).ConfigureAwait(false); } /// - /// Get a BgpPeer + /// Get a StorageClassResource /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} /// /// /// Operation Id - /// BgpPeers_Get + /// StorageClass_Get /// /// /// Default Api Version @@ -95,26 +95,26 @@ public static async Task> GetConnected /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. - /// The name of the BgpPeer. + /// The name of the the storage class. /// 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 GetConnectedClusterBgpPeer(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + public static Response GetConnectedClusterStorageClass(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeer(scope, bgpPeerName, cancellationToken); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClass(scope, storageClassName, cancellationToken); } /// @@ -214,33 +214,33 @@ public static Response GetConnectedCluster } /// - /// Gets a collection of ConnectedClusterServiceResources in the ArmClient. + /// Gets a collection of ConnectedClusterBgpPeerResources in the ArmClient. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// is null. - /// An object representing collection of ConnectedClusterServiceResources and their operations over a ConnectedClusterServiceResource. - public static ConnectedClusterServiceCollection GetConnectedClusterServices(this ArmClient client, ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterBgpPeerResources and their operations over a ConnectedClusterBgpPeerResource. + public static ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(this ArmClient client, ResourceIdentifier scope) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterServices(scope); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeers(scope); } /// - /// Get a ServiceResource + /// Get a BgpPeer /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} /// /// /// Operation Id - /// Services_Get + /// BgpPeers_Get /// /// /// Default Api Version @@ -248,38 +248,38 @@ public static ConnectedClusterServiceCollection GetConnectedClusterServices(this /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. - /// The name of the the service. + /// The name of the BgpPeer. /// 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> GetConnectedClusterServiceAsync(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + public static async Task> GetConnectedClusterBgpPeerAsync(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterServiceAsync(scope, serviceName, cancellationToken).ConfigureAwait(false); + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeerAsync(scope, bgpPeerName, cancellationToken).ConfigureAwait(false); } /// - /// Get a ServiceResource + /// Get a BgpPeer /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} /// /// /// Operation Id - /// Services_Get + /// BgpPeers_Get /// /// /// Default Api Version @@ -287,56 +287,56 @@ public static async Task> GetConnected /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. - /// The name of the the service. + /// The name of the BgpPeer. /// 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 GetConnectedClusterService(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + public static Response GetConnectedClusterBgpPeer(this ArmClient client, ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterService(scope, serviceName, cancellationToken); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeer(scope, bgpPeerName, cancellationToken); } /// - /// Gets a collection of ConnectedClusterStorageClassResources in the ArmClient. + /// Gets a collection of ConnectedClusterServiceResources in the ArmClient. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// is null. - /// An object representing collection of ConnectedClusterStorageClassResources and their operations over a ConnectedClusterStorageClassResource. - public static ConnectedClusterStorageClassCollection GetConnectedClusterStorageClasses(this ArmClient client, ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterServiceResources and their operations over a ConnectedClusterServiceResource. + public static ConnectedClusterServiceCollection GetConnectedClusterServices(this ArmClient client, ResourceIdentifier scope) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClasses(scope); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterServices(scope); } /// - /// Get a StorageClassResource + /// Get a ServiceResource /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} /// /// /// Operation Id - /// StorageClass_Get + /// Services_Get /// /// /// Default Api Version @@ -344,38 +344,38 @@ public static ConnectedClusterStorageClassCollection GetConnectedClusterStorageC /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. - /// The name of the the storage class. + /// The name of the the service. /// 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> GetConnectedClusterStorageClassAsync(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + public static async Task> GetConnectedClusterServiceAsync(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClassAsync(scope, storageClassName, cancellationToken).ConfigureAwait(false); + return await GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterServiceAsync(scope, serviceName, cancellationToken).ConfigureAwait(false); } /// - /// Get a StorageClassResource + /// Get a ServiceResource /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} /// /// /// Operation Id - /// StorageClass_Get + /// Services_Get /// /// /// Default Api Version @@ -383,45 +383,45 @@ public static async Task> GetConn /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. - /// The name of the the storage class. + /// The name of the the service. /// 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 GetConnectedClusterStorageClass(this ArmClient client, ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + public static Response GetConnectedClusterService(this ArmClient client, ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClass(scope, storageClassName, cancellationToken); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterService(scope, serviceName, cancellationToken); } /// - /// 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 ConnectedClusterBgpPeerResource GetConnectedClusterBgpPeerResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ConnectedClusterStorageClassResource GetConnectedClusterStorageClassResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeerResource(id); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClassResource(id); } /// @@ -444,41 +444,41 @@ public static ConnectedClusterLoadBalancerResource GetConnectedClusterLoadBalanc } /// - /// 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 ConnectedClusterServiceResource GetConnectedClusterServiceResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ConnectedClusterBgpPeerResource GetConnectedClusterBgpPeerResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterServiceResource(id); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterBgpPeerResource(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 ConnectedClusterStorageClassResource GetConnectedClusterStorageClassResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ConnectedClusterServiceResource GetConnectedClusterServiceResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterStorageClassResource(id); + return GetMockableContainerOrchestratorRuntimeArmClient(client).GetConnectedClusterServiceResource(id); } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs index 9cb2faade472d..e116a985d93d0 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Extensions/MockableContainerOrchestratorRuntimeArmClient.cs @@ -37,24 +37,24 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of ConnectedClusterBgpPeerResources in the ArmClient. + /// Gets a collection of ConnectedClusterStorageClassResources in the ArmClient. /// The scope that the resource will apply against. - /// An object representing collection of ConnectedClusterBgpPeerResources and their operations over a ConnectedClusterBgpPeerResource. - public virtual ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterStorageClassResources and their operations over a ConnectedClusterStorageClassResource. + public virtual ConnectedClusterStorageClassCollection GetConnectedClusterStorageClasses(ResourceIdentifier scope) { - return new ConnectedClusterBgpPeerCollection(Client, scope); + return new ConnectedClusterStorageClassCollection(Client, scope); } /// - /// Get a BgpPeer + /// Get a StorageClassResource /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} /// /// /// Operation Id - /// BgpPeers_Get + /// StorageClass_Get /// /// /// Default Api Version @@ -62,31 +62,31 @@ public virtual ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(Res /// /// /// Resource - /// + /// /// /// /// /// The scope that the resource will apply against. - /// The name of the BgpPeer. + /// The name of the the storage class. /// 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> GetConnectedClusterBgpPeerAsync(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + public virtual async Task> GetConnectedClusterStorageClassAsync(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) { - return await GetConnectedClusterBgpPeers(scope).GetAsync(bgpPeerName, cancellationToken).ConfigureAwait(false); + return await GetConnectedClusterStorageClasses(scope).GetAsync(storageClassName, cancellationToken).ConfigureAwait(false); } /// - /// Get a BgpPeer + /// Get a StorageClassResource /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} /// /// /// Operation Id - /// BgpPeers_Get + /// StorageClass_Get /// /// /// Default Api Version @@ -94,19 +94,19 @@ public virtual async Task> GetConnecte /// /// /// Resource - /// + /// /// /// /// /// The scope that the resource will apply against. - /// The name of the BgpPeer. + /// The name of the the storage class. /// 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 GetConnectedClusterBgpPeer(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) + public virtual Response GetConnectedClusterStorageClass(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) { - return GetConnectedClusterBgpPeers(scope).Get(bgpPeerName, cancellationToken); + return GetConnectedClusterStorageClasses(scope).Get(storageClassName, cancellationToken); } /// Gets a collection of ConnectedClusterLoadBalancerResources in the ArmClient. @@ -181,24 +181,24 @@ public virtual Response GetConnectedCluste return GetConnectedClusterLoadBalancers(scope).Get(loadBalancerName, cancellationToken); } - /// Gets a collection of ConnectedClusterServiceResources in the ArmClient. + /// Gets a collection of ConnectedClusterBgpPeerResources in the ArmClient. /// The scope that the resource will apply against. - /// An object representing collection of ConnectedClusterServiceResources and their operations over a ConnectedClusterServiceResource. - public virtual ConnectedClusterServiceCollection GetConnectedClusterServices(ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterBgpPeerResources and their operations over a ConnectedClusterBgpPeerResource. + public virtual ConnectedClusterBgpPeerCollection GetConnectedClusterBgpPeers(ResourceIdentifier scope) { - return new ConnectedClusterServiceCollection(Client, scope); + return new ConnectedClusterBgpPeerCollection(Client, scope); } /// - /// Get a ServiceResource + /// Get a BgpPeer /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} /// /// /// Operation Id - /// Services_Get + /// BgpPeers_Get /// /// /// Default Api Version @@ -206,31 +206,31 @@ public virtual ConnectedClusterServiceCollection GetConnectedClusterServices(Res /// /// /// Resource - /// + /// /// /// /// /// The scope that the resource will apply against. - /// The name of the the service. + /// The name of the BgpPeer. /// 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> GetConnectedClusterServiceAsync(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + public virtual async Task> GetConnectedClusterBgpPeerAsync(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) { - return await GetConnectedClusterServices(scope).GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + return await GetConnectedClusterBgpPeers(scope).GetAsync(bgpPeerName, cancellationToken).ConfigureAwait(false); } /// - /// Get a ServiceResource + /// Get a BgpPeer /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/bgpPeers/{bgpPeerName} /// /// /// Operation Id - /// Services_Get + /// BgpPeers_Get /// /// /// Default Api Version @@ -238,39 +238,39 @@ public virtual async Task> GetConnecte /// /// /// Resource - /// + /// /// /// /// /// The scope that the resource will apply against. - /// The name of the the service. + /// The name of the BgpPeer. /// 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 GetConnectedClusterService(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) + public virtual Response GetConnectedClusterBgpPeer(ResourceIdentifier scope, string bgpPeerName, CancellationToken cancellationToken = default) { - return GetConnectedClusterServices(scope).Get(serviceName, cancellationToken); + return GetConnectedClusterBgpPeers(scope).Get(bgpPeerName, cancellationToken); } - /// Gets a collection of ConnectedClusterStorageClassResources in the ArmClient. + /// Gets a collection of ConnectedClusterServiceResources in the ArmClient. /// The scope that the resource will apply against. - /// An object representing collection of ConnectedClusterStorageClassResources and their operations over a ConnectedClusterStorageClassResource. - public virtual ConnectedClusterStorageClassCollection GetConnectedClusterStorageClasses(ResourceIdentifier scope) + /// An object representing collection of ConnectedClusterServiceResources and their operations over a ConnectedClusterServiceResource. + public virtual ConnectedClusterServiceCollection GetConnectedClusterServices(ResourceIdentifier scope) { - return new ConnectedClusterStorageClassCollection(Client, scope); + return new ConnectedClusterServiceCollection(Client, scope); } /// - /// Get a StorageClassResource + /// Get a ServiceResource /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} /// /// /// Operation Id - /// StorageClass_Get + /// Services_Get /// /// /// Default Api Version @@ -278,31 +278,31 @@ public virtual ConnectedClusterStorageClassCollection GetConnectedClusterStorage /// /// /// Resource - /// + /// /// /// /// /// The scope that the resource will apply against. - /// The name of the the storage class. + /// The name of the the service. /// 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> GetConnectedClusterStorageClassAsync(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + public virtual async Task> GetConnectedClusterServiceAsync(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) { - return await GetConnectedClusterStorageClasses(scope).GetAsync(storageClassName, cancellationToken).ConfigureAwait(false); + return await GetConnectedClusterServices(scope).GetAsync(serviceName, cancellationToken).ConfigureAwait(false); } /// - /// Get a StorageClassResource + /// Get a ServiceResource /// /// /// Request Path - /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/storageClasses/{storageClassName} + /// /{resourceUri}/providers/Microsoft.KubernetesRuntime/services/{serviceName} /// /// /// Operation Id - /// StorageClass_Get + /// Services_Get /// /// /// Default Api Version @@ -310,31 +310,31 @@ public virtual async Task> GetCon /// /// /// Resource - /// + /// /// /// /// /// The scope that the resource will apply against. - /// The name of the the storage class. + /// The name of the the service. /// 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 GetConnectedClusterStorageClass(ResourceIdentifier scope, string storageClassName, CancellationToken cancellationToken = default) + public virtual Response GetConnectedClusterService(ResourceIdentifier scope, string serviceName, CancellationToken cancellationToken = default) { - return GetConnectedClusterStorageClasses(scope).Get(storageClassName, cancellationToken); + return GetConnectedClusterServices(scope).Get(serviceName, cancellationToken); } /// - /// 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 ConnectedClusterBgpPeerResource GetConnectedClusterBgpPeerResource(ResourceIdentifier id) + /// Returns a object. + public virtual ConnectedClusterStorageClassResource GetConnectedClusterStorageClassResource(ResourceIdentifier id) { - ConnectedClusterBgpPeerResource.ValidateResourceId(id); - return new ConnectedClusterBgpPeerResource(Client, id); + ConnectedClusterStorageClassResource.ValidateResourceId(id); + return new ConnectedClusterStorageClassResource(Client, id); } /// @@ -350,27 +350,27 @@ public virtual ConnectedClusterLoadBalancerResource GetConnectedClusterLoadBalan } /// - /// 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 ConnectedClusterServiceResource GetConnectedClusterServiceResource(ResourceIdentifier id) + /// Returns a object. + public virtual ConnectedClusterBgpPeerResource GetConnectedClusterBgpPeerResource(ResourceIdentifier id) { - ConnectedClusterServiceResource.ValidateResourceId(id); - return new ConnectedClusterServiceResource(Client, id); + ConnectedClusterBgpPeerResource.ValidateResourceId(id); + return new ConnectedClusterBgpPeerResource(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 ConnectedClusterStorageClassResource GetConnectedClusterStorageClassResource(ResourceIdentifier id) + /// Returns a object. + public virtual ConnectedClusterServiceResource GetConnectedClusterServiceResource(ResourceIdentifier id) { - ConnectedClusterStorageClassResource.ValidateResourceId(id); - return new ConnectedClusterStorageClassResource(Client, id); + ConnectedClusterServiceResource.ValidateResourceId(id); + return new ConnectedClusterServiceResource(Client, id); } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs index 306f663ced624..dfef894940b9e 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/BlobStorageClassTypeProperties.cs @@ -24,19 +24,19 @@ public BlobStorageClassTypeProperties(string azureStorageAccountName, string azu AzureStorageAccountName = azureStorageAccountName; AzureStorageAccountKey = azureStorageAccountKey; - ClassType = StorageClassType.Blob; + Type = StorageClassType.Blob; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. /// Azure Storage Account Name. /// Azure Storage Account Key. - internal BlobStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData, string azureStorageAccountName, string azureStorageAccountKey) : base(classType, serializedAdditionalRawData) + internal BlobStorageClassTypeProperties(StorageClassType type, IDictionary serializedAdditionalRawData, string azureStorageAccountName, string azureStorageAccountKey) : base(type, serializedAdditionalRawData) { AzureStorageAccountName = azureStorageAccountName; AzureStorageAccountKey = azureStorageAccountKey; - ClassType = classType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterBgpPeerProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterBgpPeerProperties.Serialization.cs new file mode 100644 index 0000000000000..d44c4b53adf05 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterBgpPeerProperties.Serialization.cs @@ -0,0 +1,157 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + public partial class ConnectedClusterBgpPeerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedClusterBgpPeerProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("myAsn"u8); + writer.WriteNumberValue(MyAsn); + writer.WritePropertyName("peerAsn"u8); + writer.WriteNumberValue(PeerAsn); + writer.WritePropertyName("peerAddress"u8); + writer.WriteStringValue(PeerAddress); + 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 + } + } + } + + ConnectedClusterBgpPeerProperties 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(ConnectedClusterBgpPeerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedClusterBgpPeerProperties(document.RootElement, options); + } + + internal static ConnectedClusterBgpPeerProperties DeserializeConnectedClusterBgpPeerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int myAsn = default; + int peerAsn = default; + string peerAddress = default; + ContainerOrchestratorProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("myAsn"u8)) + { + myAsn = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("peerAsn"u8)) + { + peerAsn = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("peerAddress"u8)) + { + peerAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerOrchestratorProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedClusterBgpPeerProperties(myAsn, peerAsn, peerAddress, 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(ConnectedClusterBgpPeerProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectedClusterBgpPeerProperties 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 DeserializeConnectedClusterBgpPeerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedClusterBgpPeerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterBgpPeerProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterBgpPeerProperties.cs new file mode 100644 index 0000000000000..7ed798f27d21c --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterBgpPeerProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// Details of the BgpPeer. + public partial class ConnectedClusterBgpPeerProperties + { + /// + /// 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 . + /// My ASN. + /// Peer ASN. + /// Peer Address. + /// is null. + public ConnectedClusterBgpPeerProperties(int myAsn, int peerAsn, string peerAddress) + { + Argument.AssertNotNull(peerAddress, nameof(peerAddress)); + + MyAsn = myAsn; + PeerAsn = peerAsn; + PeerAddress = peerAddress; + } + + /// Initializes a new instance of . + /// My ASN. + /// Peer ASN. + /// Peer Address. + /// Resource provision state. + /// Keeps track of any properties unknown to the library. + internal ConnectedClusterBgpPeerProperties(int myAsn, int peerAsn, string peerAddress, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + MyAsn = myAsn; + PeerAsn = peerAsn; + PeerAddress = peerAddress; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectedClusterBgpPeerProperties() + { + } + + /// My ASN. + public int MyAsn { get; set; } + /// Peer ASN. + public int PeerAsn { get; set; } + /// Peer Address. + public string PeerAddress { get; set; } + /// Resource provision state. + public ContainerOrchestratorProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterLoadBalancerProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterLoadBalancerProperties.Serialization.cs new file mode 100644 index 0000000000000..7602382cb0226 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterLoadBalancerProperties.Serialization.cs @@ -0,0 +1,216 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + public partial class ConnectedClusterLoadBalancerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedClusterLoadBalancerProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("addresses"u8); + writer.WriteStartArray(); + foreach (var item in Addresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(ServiceSelector)) + { + writer.WritePropertyName("serviceSelector"u8); + writer.WriteStartObject(); + foreach (var item in ServiceSelector) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("advertiseMode"u8); + writer.WriteStringValue(AdvertiseMode.ToString()); + if (Optional.IsCollectionDefined(BgpPeers)) + { + writer.WritePropertyName("bgpPeers"u8); + writer.WriteStartArray(); + foreach (var item in BgpPeers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + 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 + } + } + } + + ConnectedClusterLoadBalancerProperties 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(ConnectedClusterLoadBalancerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedClusterLoadBalancerProperties(document.RootElement, options); + } + + internal static ConnectedClusterLoadBalancerProperties DeserializeConnectedClusterLoadBalancerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList addresses = default; + IDictionary serviceSelector = default; + AdvertiseMode advertiseMode = default; + IList bgpPeers = default; + ContainerOrchestratorProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("addresses"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + addresses = array; + continue; + } + if (property.NameEquals("serviceSelector"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()); + } + serviceSelector = dictionary; + continue; + } + if (property.NameEquals("advertiseMode"u8)) + { + advertiseMode = new AdvertiseMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("bgpPeers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + bgpPeers = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerOrchestratorProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedClusterLoadBalancerProperties( + addresses, + serviceSelector ?? new ChangeTrackingDictionary(), + advertiseMode, + bgpPeers ?? new ChangeTrackingList(), + 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(ConnectedClusterLoadBalancerProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectedClusterLoadBalancerProperties 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 DeserializeConnectedClusterLoadBalancerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedClusterLoadBalancerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterLoadBalancerProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterLoadBalancerProperties.cs new file mode 100644 index 0000000000000..97422adba4e1a --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterLoadBalancerProperties.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// Details of the LoadBalancer. + public partial class ConnectedClusterLoadBalancerProperties + { + /// + /// 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 . + /// IP Range. + /// Advertise Mode. + /// is null. + public ConnectedClusterLoadBalancerProperties(IEnumerable addresses, AdvertiseMode advertiseMode) + { + Argument.AssertNotNull(addresses, nameof(addresses)); + + Addresses = addresses.ToList(); + ServiceSelector = new ChangeTrackingDictionary(); + AdvertiseMode = advertiseMode; + BgpPeers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// IP Range. + /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label "a=b", then please specify {"a": "b"} in the field. + /// Advertise Mode. + /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. + /// Resource provision state. + /// Keeps track of any properties unknown to the library. + internal ConnectedClusterLoadBalancerProperties(IList addresses, IDictionary serviceSelector, AdvertiseMode advertiseMode, IList bgpPeers, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Addresses = addresses; + ServiceSelector = serviceSelector; + AdvertiseMode = advertiseMode; + BgpPeers = bgpPeers; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectedClusterLoadBalancerProperties() + { + } + + /// IP Range. + public IList Addresses { get; } + /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label "a=b", then please specify {"a": "b"} in the field. + public IDictionary ServiceSelector { get; } + /// Advertise Mode. + public AdvertiseMode AdvertiseMode { get; set; } + /// The list of BGP peers it should advertise to. Null or empty means to advertise to all peers. + public IList BgpPeers { get; } + /// Resource provision state. + public ContainerOrchestratorProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterServiceProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterServiceProperties.Serialization.cs new file mode 100644 index 0000000000000..19a211e541f0c --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterServiceProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + public partial class ConnectedClusterServiceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedClusterServiceProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(RpObjectId)) + { + writer.WritePropertyName("rpObjectId"u8); + writer.WriteStringValue(RpObjectId.Value); + } + 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 + } + } + } + + ConnectedClusterServiceProperties 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(ConnectedClusterServiceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedClusterServiceProperties(document.RootElement, options); + } + + internal static ConnectedClusterServiceProperties DeserializeConnectedClusterServiceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid? rpObjectId = default; + ContainerOrchestratorProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rpObjectId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rpObjectId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerOrchestratorProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedClusterServiceProperties(rpObjectId, 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(ConnectedClusterServiceProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectedClusterServiceProperties 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 DeserializeConnectedClusterServiceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedClusterServiceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterServiceProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterServiceProperties.cs new file mode 100644 index 0000000000000..4d8e7debbdcd6 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterServiceProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// Properties for the service resource. + public partial class ConnectedClusterServiceProperties + { + /// + /// 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 ConnectedClusterServiceProperties() + { + } + + /// Initializes a new instance of . + /// The object id of the service principal of the RP provisioned in the tenant. + /// Resource provision state. + /// Keeps track of any properties unknown to the library. + internal ConnectedClusterServiceProperties(Guid? rpObjectId, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + RpObjectId = rpObjectId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The object id of the service principal of the RP provisioned in the tenant. + public Guid? RpObjectId { get; } + /// Resource provision state. + public ContainerOrchestratorProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassProperties.Serialization.cs new file mode 100644 index 0000000000000..85d4caef86885 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassProperties.Serialization.cs @@ -0,0 +1,330 @@ +// 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.ContainerOrchestratorRuntime.Models +{ + public partial class ConnectedClusterStorageClassProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AllowVolumeExpansion)) + { + writer.WritePropertyName("allowVolumeExpansion"u8); + writer.WriteStringValue(AllowVolumeExpansion.Value.ToString()); + } + if (Optional.IsCollectionDefined(MountOptions)) + { + writer.WritePropertyName("mountOptions"u8); + writer.WriteStartArray(); + foreach (var item in MountOptions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Provisioner)) + { + writer.WritePropertyName("provisioner"u8); + writer.WriteStringValue(Provisioner); + } + if (Optional.IsDefined(VolumeBindingMode)) + { + writer.WritePropertyName("volumeBindingMode"u8); + writer.WriteStringValue(VolumeBindingMode.Value.ToString()); + } + if (Optional.IsCollectionDefined(AccessModes)) + { + writer.WritePropertyName("accessModes"u8); + writer.WriteStartArray(); + foreach (var item in AccessModes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataResilience)) + { + writer.WritePropertyName("dataResilience"u8); + writer.WriteStringValue(DataResilience.Value.ToString()); + } + if (Optional.IsDefined(FailoverSpeed)) + { + writer.WritePropertyName("failoverSpeed"u8); + writer.WriteStringValue(FailoverSpeed.Value.ToString()); + } + if (Optional.IsCollectionDefined(Limitations)) + { + writer.WritePropertyName("limitations"u8); + writer.WriteStartArray(); + foreach (var item in Limitations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Performance)) + { + writer.WritePropertyName("performance"u8); + writer.WriteStringValue(Performance.Value.ToString()); + } + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority.Value); + } + writer.WritePropertyName("typeProperties"u8); + writer.WriteObjectValue(TypeProperties, options); + 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 + } + } + } + + ConnectedClusterStorageClassProperties 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(ConnectedClusterStorageClassProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedClusterStorageClassProperties(document.RootElement, options); + } + + internal static ConnectedClusterStorageClassProperties DeserializeConnectedClusterStorageClassProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VolumeExpansion? allowVolumeExpansion = default; + IList mountOptions = default; + string provisioner = default; + VolumeBindingMode? volumeBindingMode = default; + IList accessModes = default; + DataResilienceTier? dataResilience = default; + FailoverTier? failoverSpeed = default; + IList limitations = default; + PerformanceTier? performance = default; + long? priority = default; + StorageClassTypeProperties typeProperties = default; + ContainerOrchestratorProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("allowVolumeExpansion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowVolumeExpansion = new VolumeExpansion(property.Value.GetString()); + continue; + } + if (property.NameEquals("mountOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + mountOptions = array; + continue; + } + if (property.NameEquals("provisioner"u8)) + { + provisioner = property.Value.GetString(); + continue; + } + if (property.NameEquals("volumeBindingMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + volumeBindingMode = new VolumeBindingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("accessModes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new StorageClassAccessMode(item.GetString())); + } + accessModes = array; + continue; + } + if (property.NameEquals("dataResilience"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataResilience = new DataResilienceTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("failoverSpeed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failoverSpeed = new FailoverTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("limitations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + limitations = array; + continue; + } + if (property.NameEquals("performance"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + performance = new PerformanceTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("priority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("typeProperties"u8)) + { + typeProperties = StorageClassTypeProperties.DeserializeStorageClassTypeProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerOrchestratorProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedClusterStorageClassProperties( + allowVolumeExpansion, + mountOptions ?? new ChangeTrackingList(), + provisioner, + volumeBindingMode, + accessModes ?? new ChangeTrackingList(), + dataResilience, + failoverSpeed, + limitations ?? new ChangeTrackingList(), + performance, + priority, + typeProperties, + 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(ConnectedClusterStorageClassProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectedClusterStorageClassProperties 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 DeserializeConnectedClusterStorageClassProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedClusterStorageClassProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassProperties.cs new file mode 100644 index 0000000000000..38485378322d3 --- /dev/null +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ConnectedClusterStorageClassProperties.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models +{ + /// Details of the StorageClass StorageClass. + public partial class ConnectedClusterStorageClassProperties + { + /// + /// 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 . + /// + /// Properties of the StorageClass + /// 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 , , , and . + /// + /// is null. + public ConnectedClusterStorageClassProperties(StorageClassTypeProperties typeProperties) + { + Argument.AssertNotNull(typeProperties, nameof(typeProperties)); + + MountOptions = new ChangeTrackingList(); + AccessModes = new ChangeTrackingList(); + Limitations = new ChangeTrackingList(); + TypeProperties = typeProperties; + } + + /// Initializes a new instance of . + /// Volume can be expanded or not. + /// Additional mount options. + /// Provisioner name. + /// Binding mode of volumes: Immediate, WaitForFirstConsumer. + /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. + /// Allow single data node failure. + /// Failover speed: NA, Slow, Fast. + /// Limitations of the storage class. + /// Performance tier. + /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. + /// + /// Properties of the StorageClass + /// 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 , , , and . + /// + /// Resource provision state. + /// Keeps track of any properties unknown to the library. + internal ConnectedClusterStorageClassProperties(VolumeExpansion? allowVolumeExpansion, IList mountOptions, string provisioner, VolumeBindingMode? volumeBindingMode, IList accessModes, DataResilienceTier? dataResilience, FailoverTier? failoverSpeed, IList limitations, PerformanceTier? performance, long? priority, StorageClassTypeProperties typeProperties, ContainerOrchestratorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AllowVolumeExpansion = allowVolumeExpansion; + MountOptions = mountOptions; + Provisioner = provisioner; + VolumeBindingMode = volumeBindingMode; + AccessModes = accessModes; + DataResilience = dataResilience; + FailoverSpeed = failoverSpeed; + Limitations = limitations; + Performance = performance; + Priority = priority; + TypeProperties = typeProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectedClusterStorageClassProperties() + { + } + + /// Volume can be expanded or not. + public VolumeExpansion? AllowVolumeExpansion { get; set; } + /// Additional mount options. + public IList MountOptions { get; } + /// Provisioner name. + public string Provisioner { get; set; } + /// Binding mode of volumes: Immediate, WaitForFirstConsumer. + public VolumeBindingMode? VolumeBindingMode { get; set; } + /// The access mode: [ReadWriteOnce, ReadWriteMany] or [ReadWriteOnce]. + public IList AccessModes { get; } + /// Allow single data node failure. + public DataResilienceTier? DataResilience { get; set; } + /// Failover speed: NA, Slow, Fast. + public FailoverTier? FailoverSpeed { get; set; } + /// Limitations of the storage class. + public IList Limitations { get; } + /// Performance tier. + public PerformanceTier? Performance { get; set; } + /// Selection priority when multiple storage classes meet the criteria. 0: Highest, -1: Never use. + public long? Priority { get; set; } + /// + /// Properties of the StorageClass + /// 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 , , , and . + /// + public StorageClassTypeProperties TypeProperties { get; set; } + /// Resource provision state. + public ContainerOrchestratorProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs index 82fc04b037495..77801f1345e71 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NativeStorageClassTypeProperties.cs @@ -16,15 +16,15 @@ public partial class NativeStorageClassTypeProperties : StorageClassTypeProperti /// Initializes a new instance of . public NativeStorageClassTypeProperties() { - ClassType = StorageClassType.Native; + Type = StorageClassType.Native; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. - internal NativeStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData) : base(classType, serializedAdditionalRawData) + internal NativeStorageClassTypeProperties(StorageClassType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { - ClassType = classType; + Type = type; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs index 7dc006549d85a..76deccf83be25 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsStorageClassTypeProperties.cs @@ -24,25 +24,25 @@ public NfsStorageClassTypeProperties(string server, string share) Server = server; Share = share; - ClassType = StorageClassType.Nfs; + Type = StorageClassType.Nfs; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. /// NFS Server. /// NFS share. /// Sub directory under share. If the sub directory doesn't exist, driver will create it. /// Mounted folder permissions. Default is 0. If set as non-zero, driver will perform `chmod` after mount. /// The action to take when a NFS volume is deleted. Default is Delete. - internal NfsStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData, string server, string share, string subDir, string mountPermissions, NfsDirectoryActionOnVolumeDeletion? onDelete) : base(classType, serializedAdditionalRawData) + internal NfsStorageClassTypeProperties(StorageClassType type, IDictionary serializedAdditionalRawData, string server, string share, string subDir, string mountPermissions, NfsDirectoryActionOnVolumeDeletion? onDelete) : base(type, serializedAdditionalRawData) { Server = server; Share = share; SubDir = subDir; MountPermissions = mountPermissions; OnDelete = onDelete; - ClassType = classType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs index 52b421398f2b1..265f0aa0cab14 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/RwxStorageClassTypeProperties.cs @@ -21,17 +21,17 @@ public RwxStorageClassTypeProperties(string backingStorageClassName) Argument.AssertNotNull(backingStorageClassName, nameof(backingStorageClassName)); BackingStorageClassName = backingStorageClassName; - ClassType = StorageClassType.Rwx; + Type = StorageClassType.Rwx; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. /// The backing storageclass used to create new storageclass. - internal RwxStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData, string backingStorageClassName) : base(classType, serializedAdditionalRawData) + internal RwxStorageClassTypeProperties(StorageClassType type, IDictionary serializedAdditionalRawData, string backingStorageClassName) : base(type, serializedAdditionalRawData) { BackingStorageClassName = backingStorageClassName; - ClassType = classType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs index 72c0f8686e227..e9b94101fd7df 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/SmbStorageClassTypeProperties.cs @@ -21,25 +21,25 @@ public SmbStorageClassTypeProperties(string source) Argument.AssertNotNull(source, nameof(source)); Source = source; - ClassType = StorageClassType.Smb; + Type = StorageClassType.Smb; } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. /// SMB Source. /// Sub directory under share. If the sub directory doesn't exist, driver will create it. /// Server username. /// Server password. /// Server domain. - internal SmbStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData, string source, string subDir, string username, string password, string domain) : base(classType, serializedAdditionalRawData) + internal SmbStorageClassTypeProperties(StorageClassType type, IDictionary serializedAdditionalRawData, string source, string subDir, string username, string password, string domain) : base(type, serializedAdditionalRawData) { Source = source; SubDir = subDir; Username = username; Password = password; Domain = domain; - ClassType = classType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs index 5796ea74b0383..172388b6b1cf7 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.Serialization.cs @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("type"u8); - writer.WriteStringValue(ClassType.ToString()); + writer.WriteStringValue(Type.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs index 22ce4e2fd9f5b..209dff83e7a42 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassTypeProperties.cs @@ -55,15 +55,15 @@ protected StorageClassTypeProperties() } /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. - internal StorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData) + internal StorageClassTypeProperties(StorageClassType type, IDictionary serializedAdditionalRawData) { - ClassType = classType; + Type = type; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Type of the storage class. - internal StorageClassType ClassType { get; set; } + internal StorageClassType Type { get; set; } } } diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs index feb8756103ef5..8dca1d1a75cc7 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/UnknownStorageClassTypeProperties.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Models internal partial class UnknownStorageClassTypeProperties : StorageClassTypeProperties { /// Initializes a new instance of . - /// Type of the storage class. + /// Type of the storage class. /// Keeps track of any properties unknown to the library. - internal UnknownStorageClassTypeProperties(StorageClassType classType, IDictionary serializedAdditionalRawData) : base(classType, serializedAdditionalRawData) + internal UnknownStorageClassTypeProperties(StorageClassType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { - ClassType = classType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs index 88867830f77ad..f3018170adce2 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/BgpPeersRestOperations.cs @@ -25,8 +25,8 @@ internal partial class BgpPeersRestOperations /// Initializes a new instance of BgpPeersRestOperations. /// 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 BgpPeersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { @@ -36,82 +36,6 @@ public BgpPeersRestOperations(HttpPipeline pipeline, string applicationId, Uri e _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string resourceUri) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string resourceUri) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List BgpPeer resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BgpPeerListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BgpPeerListResult.DeserializeBgpPeerListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List BgpPeer resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public Response List(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BgpPeerListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BgpPeerListResult.DeserializeBgpPeerListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string bgpPeerName) { var uri = new RawRequestUriBuilder(); @@ -360,6 +284,82 @@ public Response Delete(string resourceUri, string bgpPeerName, CancellationToken } } + internal RequestUriBuilder CreateListRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/bgpPeers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BgpPeer resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BgpPeerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BgpPeerListResult.DeserializeBgpPeerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BgpPeer resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public Response List(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BgpPeerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BgpPeerListResult.DeserializeBgpPeerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string resourceUri) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs index e9a4c221f7dc3..e4694a90fe9ee 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/LoadBalancersRestOperations.cs @@ -25,8 +25,8 @@ internal partial class LoadBalancersRestOperations /// Initializes a new instance of LoadBalancersRestOperations. /// 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 LoadBalancersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { @@ -36,82 +36,6 @@ public LoadBalancersRestOperations(HttpPipeline pipeline, string applicationId, _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string resourceUri) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string resourceUri) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List LoadBalancer resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - LoadBalancerListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LoadBalancerListResult.DeserializeLoadBalancerListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List LoadBalancer resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public Response List(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - LoadBalancerListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LoadBalancerListResult.DeserializeLoadBalancerListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string loadBalancerName) { var uri = new RawRequestUriBuilder(); @@ -360,6 +284,82 @@ public Response Delete(string resourceUri, string loadBalancerName, Cancellation } } + internal RequestUriBuilder CreateListRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/loadBalancers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List LoadBalancer resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LoadBalancerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = LoadBalancerListResult.DeserializeLoadBalancerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List LoadBalancer resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public Response List(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LoadBalancerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = LoadBalancerListResult.DeserializeLoadBalancerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string resourceUri) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs index e31a99556e874..a6a426c520107 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/ServicesRestOperations.cs @@ -25,8 +25,8 @@ internal partial class ServicesRestOperations /// Initializes a new instance of ServicesRestOperations. /// 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 ServicesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { @@ -36,82 +36,6 @@ public ServicesRestOperations(HttpPipeline pipeline, string applicationId, Uri e _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string resourceUri) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string resourceUri) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List ServiceResource resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ServiceResourceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ServiceResourceListResult.DeserializeServiceResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List ServiceResource resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public Response List(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ServiceResourceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ServiceResourceListResult.DeserializeServiceResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string serviceName) { var uri = new RawRequestUriBuilder(); @@ -370,6 +294,82 @@ public Response Delete(string resourceUri, string serviceName, CancellationToken } } + internal RequestUriBuilder CreateListRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/services", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ServiceResource resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServiceResourceListResult.DeserializeServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ServiceResource resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public Response List(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServiceResourceListResult.DeserializeServiceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string resourceUri) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs index 472d8a4ec71bb..455d0b047765a 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/RestOperations/StorageClassRestOperations.cs @@ -25,8 +25,8 @@ internal partial class StorageClassRestOperations /// Initializes a new instance of StorageClassRestOperations. /// 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 StorageClassRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { @@ -36,82 +36,6 @@ public StorageClassRestOperations(HttpPipeline pipeline, string applicationId, U _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string resourceUri) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string resourceUri) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List StorageClassResource resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StorageClassResourceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StorageClassResourceListResult.DeserializeStorageClassResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List StorageClassResource resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public Response List(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateListRequest(resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StorageClassResourceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StorageClassResourceListResult.DeserializeStorageClassResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetRequestUri(string resourceUri, string storageClassName) { var uri = new RawRequestUriBuilder(); @@ -444,6 +368,82 @@ public Response Delete(string resourceUri, string storageClassName, Cancellation } } + internal RequestUriBuilder CreateListRequestUri(string resourceUri) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string resourceUri) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(resourceUri, false); + uri.AppendPath("/providers/Microsoft.KubernetesRuntime/storageClasses", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List StorageClassResource resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StorageClassResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StorageClassResourceListResult.DeserializeStorageClassResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List StorageClassResource resources by parent. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The cancellation token to use. + /// is null. + public Response List(string resourceUri, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceUri, nameof(resourceUri)); + + using var message = CreateListRequest(resourceUri); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StorageClassResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StorageClassResourceListResult.DeserializeStorageClassResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string resourceUri) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md.bak similarity index 85% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md.bak index 21e57cb586a3f..f2c4e698847c7 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/autorest.md.bak @@ -17,6 +17,7 @@ sample-gen: skip-csproj: true modelerfour: flatten-payloads: false + flatten-models: false use-model-reader-writer: true use-write-core: true @@ -28,10 +29,13 @@ rename-mapping: AdvertiseMode.ARP: Arp AdvertiseMode.BGP: Bgp BgpPeer: ConnectedClusterBgpPeer + BgpPeerProperties: ConnectedClusterBgpPeerProperties LoadBalancer: ConnectedClusterLoadBalancer + LoadBalancerProperties: ConnectedClusterLoadBalancerProperties ServiceResource: ConnectedClusterService - ServiceResource.properties.rpObjectId: -|uuid + ServiceProperties: ConnectedClusterServiceProperties StorageClassResource: ConnectedClusterStorageClass + StorageClassProperties: ConnectedClusterStorageClassProperties ProvisioningState: ContainerOrchestratorProvisioningState SCType: StorageClassType SCType.RWX: Rwx diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs index 4be5744a790af..cd03e0d8d06fb 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/LoadBalancerTests.cs @@ -1,11 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System.Collections.Generic; using System.Threading.Tasks; -using Azure.Core; using Azure.Core.TestFramework; -using Azure.ResourceManager.ContainerOrchestratorRuntime.Mocking; using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; using Azure.ResourceManager.Kubernetes; using NUnit.Framework; @@ -25,18 +22,21 @@ public async Task CreateLoadBalancerAsync() { var connectedCluster = ConnectedClusterResource.CreateResourceIdentifier("b9e38f20-7c9c-4497-a25d-1a0c5eef2108", "xinyuhe-canary", "test-cluster-euap-arc"); var loadBalancerCollection = new ConnectedClusterLoadBalancerCollection(Client, connectedCluster); - var loadBalancerData = new ConnectedClusterLoadBalancerData + var loadBalancerData = new ConnectedClusterLoadBalancerData() { - AdvertiseMode = AdvertiseMode.Arp + Properties = new ConnectedClusterLoadBalancerProperties(new System.Collections.Generic.List(), AdvertiseMode.Arp) }; - loadBalancerData.Addresses.Add("192.168.10.1/32"); + loadBalancerData.Properties.Addresses.Add("192.168.10.1/32"); var loadBalancerResource = await loadBalancerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testlb", loadBalancerData); await loadBalancerResource.Value.DeleteAsync(WaitUntil.Completed); var bgpPeerData = new ConnectedClusterBgpPeerData { - MyAsn = 64000, - PeerAsn = 64001, - PeerAddress = "192.168.2.0" + Properties = new ConnectedClusterBgpPeerProperties + { + MyAsn = 64000, + PeerAsn = 64001, + PeerAddress = "192.168.2.0" + } }; var bgpPeerCollection = new ConnectedClusterBgpPeerCollection(Client, connectedCluster); var bgpPeerResource = await bgpPeerCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testpeer", bgpPeerData); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs index 0f317a9e06329..70378e5fc9683 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tests/Scenario/StorageClassTests.cs @@ -1,12 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System.Collections.Generic; using System.Threading.Tasks; -using Azure.Core; using Azure.Core.TestFramework; using Azure.ResourceManager.ContainerOrchestratorRuntime.Models; -using Azure.ResourceManager.Kubernetes; using NUnit.Framework; namespace Azure.ResourceManager.ContainerOrchestratorRuntime.Tests.Tests @@ -25,7 +22,7 @@ public async Task CreateStorageClassAsync() var nfsStorageClassTypeProperties = new NfsStorageClassTypeProperties("172.23.1.4", "/"); var storageClassData = new ConnectedClusterStorageClassData { - TypeProperties = nfsStorageClassTypeProperties + Properties = new ConnectedClusterStorageClassProperties(nfsStorageClassTypeProperties) }; var storageClassCollection = new ConnectedClusterStorageClassCollection(Client, TestEnvironment.ConnectedCluster); var storageClassResource = await storageClassCollection.CreateOrUpdateAsync(WaitUntil.Completed, "testsc", storageClassData); diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml.bak b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml similarity index 69% rename from sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml.bak rename to sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml index a5e8121d866fc..d76d2844d2f4b 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml.bak +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification\kubernetesruntime\KubernetesRuntime.Management -commit: 51bf99aaafdbb7844087f0e1d4eb05dd74b86e77 +commit: 4bb7f367521681118a4123c6d80489f2606cab49 repo: ArthurMa1978/azure-rest-api-specs \ No newline at end of file From 750578c8c76f13dde62d21410b6250da13a9cf18 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 30 Sep 2024 14:44:34 +0800 Subject: [PATCH 18/20] update --- .../src/Generated/Models/AdvertiseMode.cs | 2 +- .../Generated/Models/ContainerOrchestratorProvisioningState.cs | 2 +- .../src/Generated/Models/DataResilienceTier.cs | 2 +- .../src/Generated/Models/FailoverTier.cs | 2 +- .../src/Generated/Models/NfsDirectoryActionOnVolumeDeletion.cs | 2 +- .../src/Generated/Models/PerformanceTier.cs | 2 +- .../src/Generated/Models/StorageClassAccessMode.cs | 2 +- .../src/Generated/Models/StorageClassType.cs | 2 +- .../src/Generated/Models/VolumeBindingMode.cs | 2 +- .../src/Generated/Models/VolumeExpansion.cs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs index 62e8d697050da..1c22641d42ee9 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/AdvertiseMode.cs @@ -36,7 +36,7 @@ public AdvertiseMode(string value) public static bool operator ==(AdvertiseMode left, AdvertiseMode right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(AdvertiseMode left, AdvertiseMode right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator AdvertiseMode(string value) => new AdvertiseMode(value); /// diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ContainerOrchestratorProvisioningState.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ContainerOrchestratorProvisioningState.cs index e80281532b9a3..4fd15f8768c83 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ContainerOrchestratorProvisioningState.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/ContainerOrchestratorProvisioningState.cs @@ -48,7 +48,7 @@ public ContainerOrchestratorProvisioningState(string value) public static bool operator ==(ContainerOrchestratorProvisioningState left, ContainerOrchestratorProvisioningState right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(ContainerOrchestratorProvisioningState left, ContainerOrchestratorProvisioningState right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator ContainerOrchestratorProvisioningState(string value) => new ContainerOrchestratorProvisioningState(value); /// diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/DataResilienceTier.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/DataResilienceTier.cs index f4190209bde0b..cf1e7d79602e2 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/DataResilienceTier.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/DataResilienceTier.cs @@ -33,7 +33,7 @@ public DataResilienceTier(string value) public static bool operator ==(DataResilienceTier left, DataResilienceTier right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(DataResilienceTier left, DataResilienceTier right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator DataResilienceTier(string value) => new DataResilienceTier(value); /// diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/FailoverTier.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/FailoverTier.cs index 3673a9278f651..33a052ba1c055 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/FailoverTier.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/FailoverTier.cs @@ -39,7 +39,7 @@ public FailoverTier(string value) public static bool operator ==(FailoverTier left, FailoverTier right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(FailoverTier left, FailoverTier right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator FailoverTier(string value) => new FailoverTier(value); /// diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsDirectoryActionOnVolumeDeletion.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsDirectoryActionOnVolumeDeletion.cs index 9c745e1518c58..050175aeb6fb2 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsDirectoryActionOnVolumeDeletion.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/NfsDirectoryActionOnVolumeDeletion.cs @@ -33,7 +33,7 @@ public NfsDirectoryActionOnVolumeDeletion(string value) public static bool operator ==(NfsDirectoryActionOnVolumeDeletion left, NfsDirectoryActionOnVolumeDeletion right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(NfsDirectoryActionOnVolumeDeletion left, NfsDirectoryActionOnVolumeDeletion right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator NfsDirectoryActionOnVolumeDeletion(string value) => new NfsDirectoryActionOnVolumeDeletion(value); /// diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/PerformanceTier.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/PerformanceTier.cs index 66ae19b5c6e1a..f99d4a63a4e45 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/PerformanceTier.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/PerformanceTier.cs @@ -42,7 +42,7 @@ public PerformanceTier(string value) public static bool operator ==(PerformanceTier left, PerformanceTier right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(PerformanceTier left, PerformanceTier right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator PerformanceTier(string value) => new PerformanceTier(value); /// diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassAccessMode.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassAccessMode.cs index 2d224cd4d4b48..a05429209c06f 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassAccessMode.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassAccessMode.cs @@ -33,7 +33,7 @@ public StorageClassAccessMode(string value) public static bool operator ==(StorageClassAccessMode left, StorageClassAccessMode right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(StorageClassAccessMode left, StorageClassAccessMode right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator StorageClassAccessMode(string value) => new StorageClassAccessMode(value); /// diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassType.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassType.cs index 64c104fa028f5..ceee73733c394 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassType.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/StorageClassType.cs @@ -42,7 +42,7 @@ public StorageClassType(string value) public static bool operator ==(StorageClassType left, StorageClassType right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(StorageClassType left, StorageClassType right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator StorageClassType(string value) => new StorageClassType(value); /// diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeBindingMode.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeBindingMode.cs index 7b7308f9cc42f..35be2b1a88ee0 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeBindingMode.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeBindingMode.cs @@ -33,7 +33,7 @@ public VolumeBindingMode(string value) public static bool operator ==(VolumeBindingMode left, VolumeBindingMode right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(VolumeBindingMode left, VolumeBindingMode right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator VolumeBindingMode(string value) => new VolumeBindingMode(value); /// diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeExpansion.cs b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeExpansion.cs index b7747ae1b62e3..ff1965551f9b6 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeExpansion.cs +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/src/Generated/Models/VolumeExpansion.cs @@ -33,7 +33,7 @@ public VolumeExpansion(string value) public static bool operator ==(VolumeExpansion left, VolumeExpansion right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(VolumeExpansion left, VolumeExpansion right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator VolumeExpansion(string value) => new VolumeExpansion(value); /// From 53eb4377a59d1657a36beacf5fb824e8628767d3 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 17 Oct 2024 15:31:44 +0800 Subject: [PATCH 19/20] update --- .../tsp-location.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml index d76d2844d2f4b..5d54e9f49f79a 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification\kubernetesruntime\KubernetesRuntime.Management -commit: 4bb7f367521681118a4123c6d80489f2606cab49 -repo: ArthurMa1978/azure-rest-api-specs \ No newline at end of file +commit: 95e89f00932d2a8f04ff80e28f8ce10ee586ca7d +repo: Azure/azure-rest-api-specs \ No newline at end of file From 4242ba3f69ad29f6a5d696fad767eb75df4f4642 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 17 Oct 2024 15:33:15 +0800 Subject: [PATCH 20/20] update changelog --- .../CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md index 6a9f3bac33c1d..3a9430c31ae44 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-10-18) ### Features Added